1package hybridnetwork 2 3// Copyright (c) Microsoft and contributors. All rights reserved. 4// 5// Licensed under the Apache License, Version 2.0 (the "License"); 6// you may not use this file except in compliance with the License. 7// You may obtain a copy of the License at 8// http://www.apache.org/licenses/LICENSE-2.0 9// 10// Unless required by applicable law or agreed to in writing, software 11// distributed under the License is distributed on an "AS IS" BASIS, 12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13// 14// See the License for the specific language governing permissions and 15// limitations under the License. 16// 17// Code generated by Microsoft (R) AutoRest Code Generator. 18// Changes may cause incorrect behavior and will be lost if the code is regenerated. 19 20import ( 21 "context" 22 "encoding/json" 23 "github.com/Azure/go-autorest/autorest" 24 "github.com/Azure/go-autorest/autorest/azure" 25 "github.com/Azure/go-autorest/autorest/to" 26 "github.com/Azure/go-autorest/tracing" 27 "net/http" 28) 29 30// The package's fully qualified name. 31const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/hybridnetwork/mgmt/2020-01-01-preview/hybridnetwork" 32 33// AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag. 34type AzureEntityResource struct { 35 // Etag - READ-ONLY; Resource Etag. 36 Etag *string `json:"etag,omitempty"` 37 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 38 ID *string `json:"id,omitempty"` 39 // Name - READ-ONLY; The name of the resource 40 Name *string `json:"name,omitempty"` 41 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 42 Type *string `json:"type,omitempty"` 43} 44 45// CustomProfile specifies the custom settings for the virtual machine. 46type CustomProfile struct { 47 // MetadataConfigurationPath - Path for metadata configuration. 48 MetadataConfigurationPath *string `json:"metadataConfigurationPath,omitempty"` 49} 50 51// DataDisk specifies information about the operating system disk used by the virtual machine. <br><br> For 52// more information about disks, see [About disks and VHDs for Azure virtual 53// machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). 54type DataDisk struct { 55 // CreateOption - Specifies how the virtual machine should be created. Possible values include: 'Unknown', 'Empty' 56 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 57 // Name - The name of data disk. 58 Name *string `json:"name,omitempty"` 59 // DiskSizeGB - Specifies the size of an empty disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image. 60 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 61} 62 63// Device device resource. 64type Device struct { 65 autorest.Response `json:"-"` 66 // BasicDevicePropertiesFormat - Device properties. 67 BasicDevicePropertiesFormat `json:"properties,omitempty"` 68 // Tags - Resource tags. 69 Tags map[string]*string `json:"tags"` 70 // Location - The geo-location where the resource lives 71 Location *string `json:"location,omitempty"` 72 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 73 ID *string `json:"id,omitempty"` 74 // Name - READ-ONLY; The name of the resource 75 Name *string `json:"name,omitempty"` 76 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 77 Type *string `json:"type,omitempty"` 78} 79 80// MarshalJSON is the custom marshaler for Device. 81func (d Device) MarshalJSON() ([]byte, error) { 82 objectMap := make(map[string]interface{}) 83 objectMap["properties"] = d.BasicDevicePropertiesFormat 84 if d.Tags != nil { 85 objectMap["tags"] = d.Tags 86 } 87 if d.Location != nil { 88 objectMap["location"] = d.Location 89 } 90 return json.Marshal(objectMap) 91} 92 93// UnmarshalJSON is the custom unmarshaler for Device struct. 94func (d *Device) UnmarshalJSON(body []byte) error { 95 var m map[string]*json.RawMessage 96 err := json.Unmarshal(body, &m) 97 if err != nil { 98 return err 99 } 100 for k, v := range m { 101 switch k { 102 case "properties": 103 if v != nil { 104 basicDevicePropertiesFormat, err := unmarshalBasicDevicePropertiesFormat(*v) 105 if err != nil { 106 return err 107 } 108 d.BasicDevicePropertiesFormat = basicDevicePropertiesFormat 109 } 110 case "tags": 111 if v != nil { 112 var tags map[string]*string 113 err = json.Unmarshal(*v, &tags) 114 if err != nil { 115 return err 116 } 117 d.Tags = tags 118 } 119 case "location": 120 if v != nil { 121 var location string 122 err = json.Unmarshal(*v, &location) 123 if err != nil { 124 return err 125 } 126 d.Location = &location 127 } 128 case "id": 129 if v != nil { 130 var ID string 131 err = json.Unmarshal(*v, &ID) 132 if err != nil { 133 return err 134 } 135 d.ID = &ID 136 } 137 case "name": 138 if v != nil { 139 var name string 140 err = json.Unmarshal(*v, &name) 141 if err != nil { 142 return err 143 } 144 d.Name = &name 145 } 146 case "type": 147 if v != nil { 148 var typeVar string 149 err = json.Unmarshal(*v, &typeVar) 150 if err != nil { 151 return err 152 } 153 d.Type = &typeVar 154 } 155 } 156 } 157 158 return nil 159} 160 161// DeviceListResult response for devices API service call. 162type DeviceListResult struct { 163 autorest.Response `json:"-"` 164 // Value - A list of devices. 165 Value *[]Device `json:"value,omitempty"` 166 // NextLink - READ-ONLY; The URL to get the next set of results. 167 NextLink *string `json:"nextLink,omitempty"` 168} 169 170// MarshalJSON is the custom marshaler for DeviceListResult. 171func (dlr DeviceListResult) MarshalJSON() ([]byte, error) { 172 objectMap := make(map[string]interface{}) 173 if dlr.Value != nil { 174 objectMap["value"] = dlr.Value 175 } 176 return json.Marshal(objectMap) 177} 178 179// DeviceListResultIterator provides access to a complete listing of Device values. 180type DeviceListResultIterator struct { 181 i int 182 page DeviceListResultPage 183} 184 185// NextWithContext advances to the next value. If there was an error making 186// the request the iterator does not advance and the error is returned. 187func (iter *DeviceListResultIterator) NextWithContext(ctx context.Context) (err error) { 188 if tracing.IsEnabled() { 189 ctx = tracing.StartSpan(ctx, fqdn+"/DeviceListResultIterator.NextWithContext") 190 defer func() { 191 sc := -1 192 if iter.Response().Response.Response != nil { 193 sc = iter.Response().Response.Response.StatusCode 194 } 195 tracing.EndSpan(ctx, sc, err) 196 }() 197 } 198 iter.i++ 199 if iter.i < len(iter.page.Values()) { 200 return nil 201 } 202 err = iter.page.NextWithContext(ctx) 203 if err != nil { 204 iter.i-- 205 return err 206 } 207 iter.i = 0 208 return nil 209} 210 211// Next advances to the next value. If there was an error making 212// the request the iterator does not advance and the error is returned. 213// Deprecated: Use NextWithContext() instead. 214func (iter *DeviceListResultIterator) Next() error { 215 return iter.NextWithContext(context.Background()) 216} 217 218// NotDone returns true if the enumeration should be started or is not yet complete. 219func (iter DeviceListResultIterator) NotDone() bool { 220 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 221} 222 223// Response returns the raw server response from the last page request. 224func (iter DeviceListResultIterator) Response() DeviceListResult { 225 return iter.page.Response() 226} 227 228// Value returns the current value or a zero-initialized value if the 229// iterator has advanced beyond the end of the collection. 230func (iter DeviceListResultIterator) Value() Device { 231 if !iter.page.NotDone() { 232 return Device{} 233 } 234 return iter.page.Values()[iter.i] 235} 236 237// Creates a new instance of the DeviceListResultIterator type. 238func NewDeviceListResultIterator(page DeviceListResultPage) DeviceListResultIterator { 239 return DeviceListResultIterator{page: page} 240} 241 242// IsEmpty returns true if the ListResult contains no values. 243func (dlr DeviceListResult) IsEmpty() bool { 244 return dlr.Value == nil || len(*dlr.Value) == 0 245} 246 247// hasNextLink returns true if the NextLink is not empty. 248func (dlr DeviceListResult) hasNextLink() bool { 249 return dlr.NextLink != nil && len(*dlr.NextLink) != 0 250} 251 252// deviceListResultPreparer prepares a request to retrieve the next set of results. 253// It returns nil if no more results exist. 254func (dlr DeviceListResult) deviceListResultPreparer(ctx context.Context) (*http.Request, error) { 255 if !dlr.hasNextLink() { 256 return nil, nil 257 } 258 return autorest.Prepare((&http.Request{}).WithContext(ctx), 259 autorest.AsJSON(), 260 autorest.AsGet(), 261 autorest.WithBaseURL(to.String(dlr.NextLink))) 262} 263 264// DeviceListResultPage contains a page of Device values. 265type DeviceListResultPage struct { 266 fn func(context.Context, DeviceListResult) (DeviceListResult, error) 267 dlr DeviceListResult 268} 269 270// NextWithContext advances to the next page of values. If there was an error making 271// the request the page does not advance and the error is returned. 272func (page *DeviceListResultPage) NextWithContext(ctx context.Context) (err error) { 273 if tracing.IsEnabled() { 274 ctx = tracing.StartSpan(ctx, fqdn+"/DeviceListResultPage.NextWithContext") 275 defer func() { 276 sc := -1 277 if page.Response().Response.Response != nil { 278 sc = page.Response().Response.Response.StatusCode 279 } 280 tracing.EndSpan(ctx, sc, err) 281 }() 282 } 283 for { 284 next, err := page.fn(ctx, page.dlr) 285 if err != nil { 286 return err 287 } 288 page.dlr = next 289 if !next.hasNextLink() || !next.IsEmpty() { 290 break 291 } 292 } 293 return nil 294} 295 296// Next advances to the next page of values. If there was an error making 297// the request the page does not advance and the error is returned. 298// Deprecated: Use NextWithContext() instead. 299func (page *DeviceListResultPage) Next() error { 300 return page.NextWithContext(context.Background()) 301} 302 303// NotDone returns true if the page enumeration should be started or is not yet complete. 304func (page DeviceListResultPage) NotDone() bool { 305 return !page.dlr.IsEmpty() 306} 307 308// Response returns the raw server response from the last page request. 309func (page DeviceListResultPage) Response() DeviceListResult { 310 return page.dlr 311} 312 313// Values returns the slice of values for the current page or nil if there are no values. 314func (page DeviceListResultPage) Values() []Device { 315 if page.dlr.IsEmpty() { 316 return nil 317 } 318 return *page.dlr.Value 319} 320 321// Creates a new instance of the DeviceListResultPage type. 322func NewDeviceListResultPage(cur DeviceListResult, getNextPage func(context.Context, DeviceListResult) (DeviceListResult, error)) DeviceListResultPage { 323 return DeviceListResultPage{ 324 fn: getNextPage, 325 dlr: cur, 326 } 327} 328 329// BasicDevicePropertiesFormat device properties. 330type BasicDevicePropertiesFormat interface { 331 AsDevicePropertiesFormat() (*DevicePropertiesFormat, bool) 332} 333 334// DevicePropertiesFormat device properties. 335type DevicePropertiesFormat struct { 336 // Status - READ-ONLY; The current device status. Possible values include: 'StatusUnknown', 'StatusNotRegistered', 'StatusRegistered', 'StatusDeleted' 337 Status Status `json:"status,omitempty"` 338 // ProvisioningState - READ-ONLY; The provisioning state of the device resource. Possible values include: 'ProvisioningStateUnknown', 'ProvisioningStateSucceeded', 'ProvisioningStateAccepted', 'ProvisioningStateDeleting', 'ProvisioningStateFailed', 'ProvisioningStateCanceled', 'ProvisioningStateDeleted' 339 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 340 // AzureStackEdge - The reference to the Azure stack edge device. 341 AzureStackEdge *SubResource `json:"azureStackEdge,omitempty"` 342 // NetworkFunctions - READ-ONLY; The list of network functions deployed on the device. 343 NetworkFunctions *[]SubResource `json:"networkFunctions,omitempty"` 344 // DeviceType - Possible values include: 'DeviceTypeDevicePropertiesFormat' 345 DeviceType DeviceType `json:"deviceType,omitempty"` 346} 347 348func unmarshalBasicDevicePropertiesFormat(body []byte) (BasicDevicePropertiesFormat, error) { 349 var m map[string]interface{} 350 err := json.Unmarshal(body, &m) 351 if err != nil { 352 return nil, err 353 } 354 355 switch m["deviceType"] { 356 default: 357 var dpf DevicePropertiesFormat 358 err := json.Unmarshal(body, &dpf) 359 return dpf, err 360 } 361} 362func unmarshalBasicDevicePropertiesFormatArray(body []byte) ([]BasicDevicePropertiesFormat, error) { 363 var rawMessages []*json.RawMessage 364 err := json.Unmarshal(body, &rawMessages) 365 if err != nil { 366 return nil, err 367 } 368 369 dpfArray := make([]BasicDevicePropertiesFormat, len(rawMessages)) 370 371 for index, rawMessage := range rawMessages { 372 dpf, err := unmarshalBasicDevicePropertiesFormat(*rawMessage) 373 if err != nil { 374 return nil, err 375 } 376 dpfArray[index] = dpf 377 } 378 return dpfArray, nil 379} 380 381// MarshalJSON is the custom marshaler for DevicePropertiesFormat. 382func (dpf DevicePropertiesFormat) MarshalJSON() ([]byte, error) { 383 dpf.DeviceType = DeviceTypeDevicePropertiesFormat 384 objectMap := make(map[string]interface{}) 385 if dpf.AzureStackEdge != nil { 386 objectMap["azureStackEdge"] = dpf.AzureStackEdge 387 } 388 if dpf.DeviceType != "" { 389 objectMap["deviceType"] = dpf.DeviceType 390 } 391 return json.Marshal(objectMap) 392} 393 394// AsDevicePropertiesFormat is the BasicDevicePropertiesFormat implementation for DevicePropertiesFormat. 395func (dpf DevicePropertiesFormat) AsDevicePropertiesFormat() (*DevicePropertiesFormat, bool) { 396 return &dpf, true 397} 398 399// AsBasicDevicePropertiesFormat is the BasicDevicePropertiesFormat implementation for DevicePropertiesFormat. 400func (dpf DevicePropertiesFormat) AsBasicDevicePropertiesFormat() (BasicDevicePropertiesFormat, bool) { 401 return &dpf, true 402} 403 404// DeviceRegistrationKey the device registration key. 405type DeviceRegistrationKey struct { 406 autorest.Response `json:"-"` 407 // RegistrationKey - READ-ONLY; The registration key for the device. 408 RegistrationKey *string `json:"registrationKey,omitempty"` 409} 410 411// DevicesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 412// operation. 413type DevicesCreateOrUpdateFuture struct { 414 azure.FutureAPI 415 // Result returns the result of the asynchronous operation. 416 // If the operation has not completed it will return an error. 417 Result func(DevicesClient) (Device, error) 418} 419 420// DevicesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 421// operation. 422type DevicesDeleteFuture struct { 423 azure.FutureAPI 424 // Result returns the result of the asynchronous operation. 425 // If the operation has not completed it will return an error. 426 Result func(DevicesClient) (autorest.Response, error) 427} 428 429// ErrorAdditionalInfo the resource management error additional info. 430type ErrorAdditionalInfo struct { 431 // Type - READ-ONLY; The additional info type. 432 Type *string `json:"type,omitempty"` 433 // Info - READ-ONLY; The additional info. 434 Info interface{} `json:"info,omitempty"` 435} 436 437// ErrorDetail the error detail. 438type ErrorDetail struct { 439 // Code - READ-ONLY; The error code. 440 Code *string `json:"code,omitempty"` 441 // Message - READ-ONLY; The error message. 442 Message *string `json:"message,omitempty"` 443 // Target - READ-ONLY; The error target. 444 Target *string `json:"target,omitempty"` 445 // Details - READ-ONLY; The error details. 446 Details *[]ErrorDetail `json:"details,omitempty"` 447 // AdditionalInfo - READ-ONLY; The error additional info. 448 AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"` 449} 450 451// ErrorResponse common error response for all Azure Resource Manager APIs to return error details for 452// failed operations. (This also follows the OData error response format.). 453type ErrorResponse struct { 454 // Error - The error object. 455 Error *ErrorDetail `json:"error,omitempty"` 456} 457 458// ImageReference the image reference properties. 459type ImageReference struct { 460 // Publisher - The image publisher. 461 Publisher *string `json:"publisher,omitempty"` 462 // Offer - Specifies the offer of the image used to create the virtual machine. 463 Offer *string `json:"offer,omitempty"` 464 // Sku - The image SKU. 465 Sku *string `json:"sku,omitempty"` 466 // Version - Specifies the version of the image used to create the virtual machine. The allowed formats are Major.Minor.Build or 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to use the latest version of an image available at deploy time. Even if you use 'latest', the VM image will not automatically update after deploy time even if a new version becomes available. 467 Version *string `json:"version,omitempty"` 468 // ExactVersion - Specifies in decimal numbers, the exact version of image used to create the virtual machine. 469 ExactVersion *string `json:"exactVersion,omitempty"` 470} 471 472// LinuxConfiguration specifies the Linux operating system settings on the virtual machine. 473type LinuxConfiguration struct { 474 // SSH - Specifies the ssh key configuration for a Linux OS. 475 SSH *SSHConfiguration `json:"ssh,omitempty"` 476} 477 478// NetworkFunction network function resource response. 479type NetworkFunction struct { 480 autorest.Response `json:"-"` 481 // NetworkFunctionPropertiesFormat - Network function properties. 482 *NetworkFunctionPropertiesFormat `json:"properties,omitempty"` 483 // Etag - A unique read-only string that changes whenever the resource is updated. 484 Etag *string `json:"etag,omitempty"` 485 // Tags - Resource tags. 486 Tags map[string]*string `json:"tags"` 487 // Location - The geo-location where the resource lives 488 Location *string `json:"location,omitempty"` 489 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 490 ID *string `json:"id,omitempty"` 491 // Name - READ-ONLY; The name of the resource 492 Name *string `json:"name,omitempty"` 493 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 494 Type *string `json:"type,omitempty"` 495} 496 497// MarshalJSON is the custom marshaler for NetworkFunction. 498func (nf NetworkFunction) MarshalJSON() ([]byte, error) { 499 objectMap := make(map[string]interface{}) 500 if nf.NetworkFunctionPropertiesFormat != nil { 501 objectMap["properties"] = nf.NetworkFunctionPropertiesFormat 502 } 503 if nf.Etag != nil { 504 objectMap["etag"] = nf.Etag 505 } 506 if nf.Tags != nil { 507 objectMap["tags"] = nf.Tags 508 } 509 if nf.Location != nil { 510 objectMap["location"] = nf.Location 511 } 512 return json.Marshal(objectMap) 513} 514 515// UnmarshalJSON is the custom unmarshaler for NetworkFunction struct. 516func (nf *NetworkFunction) UnmarshalJSON(body []byte) error { 517 var m map[string]*json.RawMessage 518 err := json.Unmarshal(body, &m) 519 if err != nil { 520 return err 521 } 522 for k, v := range m { 523 switch k { 524 case "properties": 525 if v != nil { 526 var networkFunctionPropertiesFormat NetworkFunctionPropertiesFormat 527 err = json.Unmarshal(*v, &networkFunctionPropertiesFormat) 528 if err != nil { 529 return err 530 } 531 nf.NetworkFunctionPropertiesFormat = &networkFunctionPropertiesFormat 532 } 533 case "etag": 534 if v != nil { 535 var etag string 536 err = json.Unmarshal(*v, &etag) 537 if err != nil { 538 return err 539 } 540 nf.Etag = &etag 541 } 542 case "tags": 543 if v != nil { 544 var tags map[string]*string 545 err = json.Unmarshal(*v, &tags) 546 if err != nil { 547 return err 548 } 549 nf.Tags = tags 550 } 551 case "location": 552 if v != nil { 553 var location string 554 err = json.Unmarshal(*v, &location) 555 if err != nil { 556 return err 557 } 558 nf.Location = &location 559 } 560 case "id": 561 if v != nil { 562 var ID string 563 err = json.Unmarshal(*v, &ID) 564 if err != nil { 565 return err 566 } 567 nf.ID = &ID 568 } 569 case "name": 570 if v != nil { 571 var name string 572 err = json.Unmarshal(*v, &name) 573 if err != nil { 574 return err 575 } 576 nf.Name = &name 577 } 578 case "type": 579 if v != nil { 580 var typeVar string 581 err = json.Unmarshal(*v, &typeVar) 582 if err != nil { 583 return err 584 } 585 nf.Type = &typeVar 586 } 587 } 588 } 589 590 return nil 591} 592 593// NetworkFunctionListResult response for network function API service call. 594type NetworkFunctionListResult struct { 595 autorest.Response `json:"-"` 596 // Value - A list of network function resources in a subscription or resource group. 597 Value *[]NetworkFunction `json:"value,omitempty"` 598 // NextLink - READ-ONLY; The URL to get the next set of results. 599 NextLink *string `json:"nextLink,omitempty"` 600} 601 602// MarshalJSON is the custom marshaler for NetworkFunctionListResult. 603func (nflr NetworkFunctionListResult) MarshalJSON() ([]byte, error) { 604 objectMap := make(map[string]interface{}) 605 if nflr.Value != nil { 606 objectMap["value"] = nflr.Value 607 } 608 return json.Marshal(objectMap) 609} 610 611// NetworkFunctionListResultIterator provides access to a complete listing of NetworkFunction values. 612type NetworkFunctionListResultIterator struct { 613 i int 614 page NetworkFunctionListResultPage 615} 616 617// NextWithContext advances to the next value. If there was an error making 618// the request the iterator does not advance and the error is returned. 619func (iter *NetworkFunctionListResultIterator) NextWithContext(ctx context.Context) (err error) { 620 if tracing.IsEnabled() { 621 ctx = tracing.StartSpan(ctx, fqdn+"/NetworkFunctionListResultIterator.NextWithContext") 622 defer func() { 623 sc := -1 624 if iter.Response().Response.Response != nil { 625 sc = iter.Response().Response.Response.StatusCode 626 } 627 tracing.EndSpan(ctx, sc, err) 628 }() 629 } 630 iter.i++ 631 if iter.i < len(iter.page.Values()) { 632 return nil 633 } 634 err = iter.page.NextWithContext(ctx) 635 if err != nil { 636 iter.i-- 637 return err 638 } 639 iter.i = 0 640 return nil 641} 642 643// Next advances to the next value. If there was an error making 644// the request the iterator does not advance and the error is returned. 645// Deprecated: Use NextWithContext() instead. 646func (iter *NetworkFunctionListResultIterator) Next() error { 647 return iter.NextWithContext(context.Background()) 648} 649 650// NotDone returns true if the enumeration should be started or is not yet complete. 651func (iter NetworkFunctionListResultIterator) NotDone() bool { 652 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 653} 654 655// Response returns the raw server response from the last page request. 656func (iter NetworkFunctionListResultIterator) Response() NetworkFunctionListResult { 657 return iter.page.Response() 658} 659 660// Value returns the current value or a zero-initialized value if the 661// iterator has advanced beyond the end of the collection. 662func (iter NetworkFunctionListResultIterator) Value() NetworkFunction { 663 if !iter.page.NotDone() { 664 return NetworkFunction{} 665 } 666 return iter.page.Values()[iter.i] 667} 668 669// Creates a new instance of the NetworkFunctionListResultIterator type. 670func NewNetworkFunctionListResultIterator(page NetworkFunctionListResultPage) NetworkFunctionListResultIterator { 671 return NetworkFunctionListResultIterator{page: page} 672} 673 674// IsEmpty returns true if the ListResult contains no values. 675func (nflr NetworkFunctionListResult) IsEmpty() bool { 676 return nflr.Value == nil || len(*nflr.Value) == 0 677} 678 679// hasNextLink returns true if the NextLink is not empty. 680func (nflr NetworkFunctionListResult) hasNextLink() bool { 681 return nflr.NextLink != nil && len(*nflr.NextLink) != 0 682} 683 684// networkFunctionListResultPreparer prepares a request to retrieve the next set of results. 685// It returns nil if no more results exist. 686func (nflr NetworkFunctionListResult) networkFunctionListResultPreparer(ctx context.Context) (*http.Request, error) { 687 if !nflr.hasNextLink() { 688 return nil, nil 689 } 690 return autorest.Prepare((&http.Request{}).WithContext(ctx), 691 autorest.AsJSON(), 692 autorest.AsGet(), 693 autorest.WithBaseURL(to.String(nflr.NextLink))) 694} 695 696// NetworkFunctionListResultPage contains a page of NetworkFunction values. 697type NetworkFunctionListResultPage struct { 698 fn func(context.Context, NetworkFunctionListResult) (NetworkFunctionListResult, error) 699 nflr NetworkFunctionListResult 700} 701 702// NextWithContext advances to the next page of values. If there was an error making 703// the request the page does not advance and the error is returned. 704func (page *NetworkFunctionListResultPage) NextWithContext(ctx context.Context) (err error) { 705 if tracing.IsEnabled() { 706 ctx = tracing.StartSpan(ctx, fqdn+"/NetworkFunctionListResultPage.NextWithContext") 707 defer func() { 708 sc := -1 709 if page.Response().Response.Response != nil { 710 sc = page.Response().Response.Response.StatusCode 711 } 712 tracing.EndSpan(ctx, sc, err) 713 }() 714 } 715 for { 716 next, err := page.fn(ctx, page.nflr) 717 if err != nil { 718 return err 719 } 720 page.nflr = next 721 if !next.hasNextLink() || !next.IsEmpty() { 722 break 723 } 724 } 725 return nil 726} 727 728// Next advances to the next page of values. If there was an error making 729// the request the page does not advance and the error is returned. 730// Deprecated: Use NextWithContext() instead. 731func (page *NetworkFunctionListResultPage) Next() error { 732 return page.NextWithContext(context.Background()) 733} 734 735// NotDone returns true if the page enumeration should be started or is not yet complete. 736func (page NetworkFunctionListResultPage) NotDone() bool { 737 return !page.nflr.IsEmpty() 738} 739 740// Response returns the raw server response from the last page request. 741func (page NetworkFunctionListResultPage) Response() NetworkFunctionListResult { 742 return page.nflr 743} 744 745// Values returns the slice of values for the current page or nil if there are no values. 746func (page NetworkFunctionListResultPage) Values() []NetworkFunction { 747 if page.nflr.IsEmpty() { 748 return nil 749 } 750 return *page.nflr.Value 751} 752 753// Creates a new instance of the NetworkFunctionListResultPage type. 754func NewNetworkFunctionListResultPage(cur NetworkFunctionListResult, getNextPage func(context.Context, NetworkFunctionListResult) (NetworkFunctionListResult, error)) NetworkFunctionListResultPage { 755 return NetworkFunctionListResultPage{ 756 fn: getNextPage, 757 nflr: cur, 758 } 759} 760 761// NetworkFunctionPropertiesFormat network function properties. 762type NetworkFunctionPropertiesFormat struct { 763 // ProvisioningState - READ-ONLY; The provisioning state of the network function resource. Possible values include: 'ProvisioningStateUnknown', 'ProvisioningStateSucceeded', 'ProvisioningStateAccepted', 'ProvisioningStateDeleting', 'ProvisioningStateFailed', 'ProvisioningStateCanceled', 'ProvisioningStateDeleted' 764 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 765 // Device - The reference to the device resource. 766 Device *SubResource `json:"device,omitempty"` 767 // SkuName - The sku name for the network function. 768 SkuName *string `json:"skuName,omitempty"` 769 // SkuType - READ-ONLY; The sku type for the network function. Possible values include: 'SkuTypeUnknown', 'SkuTypeEvolvedPacketCore', 'SkuTypeSDWAN', 'SkuTypeFirewall' 770 SkuType SkuType `json:"skuType,omitempty"` 771 // VendorName - The vendor name for the network function. 772 VendorName *string `json:"vendorName,omitempty"` 773 // ServiceKey - READ-ONLY; The service key for the network function resource. 774 ServiceKey *string `json:"serviceKey,omitempty"` 775 // VendorProvisioningState - READ-ONLY; The vendor provisioning state for the network function resource. Possible values include: 'VendorProvisioningStateUnknown', 'VendorProvisioningStateNotProvisioned', 'VendorProvisioningStateProvisioning', 'VendorProvisioningStateProvisioned', 'VendorProvisioningStateDeprovisioned', 'VendorProvisioningStateUserDataValidationFailed' 776 VendorProvisioningState VendorProvisioningState `json:"vendorProvisioningState,omitempty"` 777 // ManagedApplication - READ-ONLY; The resource URI of the managed application. 778 ManagedApplication *SubResource `json:"managedApplication,omitempty"` 779 // ManagedApplicationParameters - The parameters for the managed application. 780 ManagedApplicationParameters interface{} `json:"managedApplicationParameters,omitempty"` 781 // NetworkFunctionUserConfigurations - The network function configurations from the user. 782 NetworkFunctionUserConfigurations *[]NetworkFunctionUserConfiguration `json:"networkFunctionUserConfigurations,omitempty"` 783} 784 785// MarshalJSON is the custom marshaler for NetworkFunctionPropertiesFormat. 786func (nfpf NetworkFunctionPropertiesFormat) MarshalJSON() ([]byte, error) { 787 objectMap := make(map[string]interface{}) 788 if nfpf.Device != nil { 789 objectMap["device"] = nfpf.Device 790 } 791 if nfpf.SkuName != nil { 792 objectMap["skuName"] = nfpf.SkuName 793 } 794 if nfpf.VendorName != nil { 795 objectMap["vendorName"] = nfpf.VendorName 796 } 797 if nfpf.ManagedApplicationParameters != nil { 798 objectMap["managedApplicationParameters"] = nfpf.ManagedApplicationParameters 799 } 800 if nfpf.NetworkFunctionUserConfigurations != nil { 801 objectMap["networkFunctionUserConfigurations"] = nfpf.NetworkFunctionUserConfigurations 802 } 803 return json.Marshal(objectMap) 804} 805 806// NetworkFunctionRoleConfiguration network function role configuration. 807type NetworkFunctionRoleConfiguration struct { 808 // RoleName - The name of the network function role. 809 RoleName *string `json:"roleName,omitempty"` 810 // RoleType - Role type. Possible values include: 'NetworkFunctionRoleConfigurationTypeUnknown', 'NetworkFunctionRoleConfigurationTypeVirtualMachine' 811 RoleType NetworkFunctionRoleConfigurationType `json:"roleType,omitempty"` 812 // VirtualMachineSize - The size of the virtual machine. Possible values include: 'VirtualMachineSizeTypesUnknown', 'VirtualMachineSizeTypesStandardD1V2', 'VirtualMachineSizeTypesStandardD2V2', 'VirtualMachineSizeTypesStandardD3V2', 'VirtualMachineSizeTypesStandardD4V2', 'VirtualMachineSizeTypesStandardD5V2', 'VirtualMachineSizeTypesStandardD11V2', 'VirtualMachineSizeTypesStandardD12V2', 'VirtualMachineSizeTypesStandardD13V2', 'VirtualMachineSizeTypesStandardDS1V2', 'VirtualMachineSizeTypesStandardDS2V2', 'VirtualMachineSizeTypesStandardDS3V2', 'VirtualMachineSizeTypesStandardDS4V2', 'VirtualMachineSizeTypesStandardDS5V2', 'VirtualMachineSizeTypesStandardDS11V2', 'VirtualMachineSizeTypesStandardDS12V2', 'VirtualMachineSizeTypesStandardDS13V2', 'VirtualMachineSizeTypesStandardF1', 'VirtualMachineSizeTypesStandardF2', 'VirtualMachineSizeTypesStandardF4', 'VirtualMachineSizeTypesStandardF8', 'VirtualMachineSizeTypesStandardF16', 'VirtualMachineSizeTypesStandardF1s', 'VirtualMachineSizeTypesStandardF2s', 'VirtualMachineSizeTypesStandardF4s', 'VirtualMachineSizeTypesStandardF8s', 'VirtualMachineSizeTypesStandardF16s' 813 VirtualMachineSize VirtualMachineSizeTypes `json:"virtualMachineSize,omitempty"` 814 // OsProfile - Specifies the operating system settings for the role instance. This value can be updated during the deployment of network function. 815 OsProfile *OsProfile `json:"osProfile,omitempty"` 816 // UserDataTemplate - The user data template for customers. This is a json schema template describing the format and data type of user data parameters. 817 UserDataTemplate interface{} `json:"userDataTemplate,omitempty"` 818 // UserDataParameters - The user parameters for customers. The format of user data parameters has to be matched with the provided user data template. 819 UserDataParameters interface{} `json:"userDataParameters,omitempty"` 820 // NetworkInterfaces - The network interface configurations. 821 NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` 822 // StorageProfile - Specifies the storage settings for the virtual machine disks. 823 StorageProfile *StorageProfile `json:"storageProfile,omitempty"` 824 // CustomProfile - Specifies the custom settings for the virtual machine. 825 CustomProfile *CustomProfile `json:"customProfile,omitempty"` 826} 827 828// NetworkFunctionRoleInstanceListResult list of role instances of vendor network function. 829type NetworkFunctionRoleInstanceListResult struct { 830 autorest.Response `json:"-"` 831 // Value - READ-ONLY; A list of role instances. 832 Value *[]RoleInstance `json:"value,omitempty"` 833 // NextLink - READ-ONLY; The URL to get the next set of results. 834 NextLink *string `json:"nextLink,omitempty"` 835} 836 837// NetworkFunctionRoleInstanceListResultIterator provides access to a complete listing of RoleInstance 838// values. 839type NetworkFunctionRoleInstanceListResultIterator struct { 840 i int 841 page NetworkFunctionRoleInstanceListResultPage 842} 843 844// NextWithContext advances to the next value. If there was an error making 845// the request the iterator does not advance and the error is returned. 846func (iter *NetworkFunctionRoleInstanceListResultIterator) NextWithContext(ctx context.Context) (err error) { 847 if tracing.IsEnabled() { 848 ctx = tracing.StartSpan(ctx, fqdn+"/NetworkFunctionRoleInstanceListResultIterator.NextWithContext") 849 defer func() { 850 sc := -1 851 if iter.Response().Response.Response != nil { 852 sc = iter.Response().Response.Response.StatusCode 853 } 854 tracing.EndSpan(ctx, sc, err) 855 }() 856 } 857 iter.i++ 858 if iter.i < len(iter.page.Values()) { 859 return nil 860 } 861 err = iter.page.NextWithContext(ctx) 862 if err != nil { 863 iter.i-- 864 return err 865 } 866 iter.i = 0 867 return nil 868} 869 870// Next advances to the next value. If there was an error making 871// the request the iterator does not advance and the error is returned. 872// Deprecated: Use NextWithContext() instead. 873func (iter *NetworkFunctionRoleInstanceListResultIterator) Next() error { 874 return iter.NextWithContext(context.Background()) 875} 876 877// NotDone returns true if the enumeration should be started or is not yet complete. 878func (iter NetworkFunctionRoleInstanceListResultIterator) NotDone() bool { 879 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 880} 881 882// Response returns the raw server response from the last page request. 883func (iter NetworkFunctionRoleInstanceListResultIterator) Response() NetworkFunctionRoleInstanceListResult { 884 return iter.page.Response() 885} 886 887// Value returns the current value or a zero-initialized value if the 888// iterator has advanced beyond the end of the collection. 889func (iter NetworkFunctionRoleInstanceListResultIterator) Value() RoleInstance { 890 if !iter.page.NotDone() { 891 return RoleInstance{} 892 } 893 return iter.page.Values()[iter.i] 894} 895 896// Creates a new instance of the NetworkFunctionRoleInstanceListResultIterator type. 897func NewNetworkFunctionRoleInstanceListResultIterator(page NetworkFunctionRoleInstanceListResultPage) NetworkFunctionRoleInstanceListResultIterator { 898 return NetworkFunctionRoleInstanceListResultIterator{page: page} 899} 900 901// IsEmpty returns true if the ListResult contains no values. 902func (nfrilr NetworkFunctionRoleInstanceListResult) IsEmpty() bool { 903 return nfrilr.Value == nil || len(*nfrilr.Value) == 0 904} 905 906// hasNextLink returns true if the NextLink is not empty. 907func (nfrilr NetworkFunctionRoleInstanceListResult) hasNextLink() bool { 908 return nfrilr.NextLink != nil && len(*nfrilr.NextLink) != 0 909} 910 911// networkFunctionRoleInstanceListResultPreparer prepares a request to retrieve the next set of results. 912// It returns nil if no more results exist. 913func (nfrilr NetworkFunctionRoleInstanceListResult) networkFunctionRoleInstanceListResultPreparer(ctx context.Context) (*http.Request, error) { 914 if !nfrilr.hasNextLink() { 915 return nil, nil 916 } 917 return autorest.Prepare((&http.Request{}).WithContext(ctx), 918 autorest.AsJSON(), 919 autorest.AsGet(), 920 autorest.WithBaseURL(to.String(nfrilr.NextLink))) 921} 922 923// NetworkFunctionRoleInstanceListResultPage contains a page of RoleInstance values. 924type NetworkFunctionRoleInstanceListResultPage struct { 925 fn func(context.Context, NetworkFunctionRoleInstanceListResult) (NetworkFunctionRoleInstanceListResult, error) 926 nfrilr NetworkFunctionRoleInstanceListResult 927} 928 929// NextWithContext advances to the next page of values. If there was an error making 930// the request the page does not advance and the error is returned. 931func (page *NetworkFunctionRoleInstanceListResultPage) NextWithContext(ctx context.Context) (err error) { 932 if tracing.IsEnabled() { 933 ctx = tracing.StartSpan(ctx, fqdn+"/NetworkFunctionRoleInstanceListResultPage.NextWithContext") 934 defer func() { 935 sc := -1 936 if page.Response().Response.Response != nil { 937 sc = page.Response().Response.Response.StatusCode 938 } 939 tracing.EndSpan(ctx, sc, err) 940 }() 941 } 942 for { 943 next, err := page.fn(ctx, page.nfrilr) 944 if err != nil { 945 return err 946 } 947 page.nfrilr = next 948 if !next.hasNextLink() || !next.IsEmpty() { 949 break 950 } 951 } 952 return nil 953} 954 955// Next advances to the next page of values. If there was an error making 956// the request the page does not advance and the error is returned. 957// Deprecated: Use NextWithContext() instead. 958func (page *NetworkFunctionRoleInstanceListResultPage) Next() error { 959 return page.NextWithContext(context.Background()) 960} 961 962// NotDone returns true if the page enumeration should be started or is not yet complete. 963func (page NetworkFunctionRoleInstanceListResultPage) NotDone() bool { 964 return !page.nfrilr.IsEmpty() 965} 966 967// Response returns the raw server response from the last page request. 968func (page NetworkFunctionRoleInstanceListResultPage) Response() NetworkFunctionRoleInstanceListResult { 969 return page.nfrilr 970} 971 972// Values returns the slice of values for the current page or nil if there are no values. 973func (page NetworkFunctionRoleInstanceListResultPage) Values() []RoleInstance { 974 if page.nfrilr.IsEmpty() { 975 return nil 976 } 977 return *page.nfrilr.Value 978} 979 980// Creates a new instance of the NetworkFunctionRoleInstanceListResultPage type. 981func NewNetworkFunctionRoleInstanceListResultPage(cur NetworkFunctionRoleInstanceListResult, getNextPage func(context.Context, NetworkFunctionRoleInstanceListResult) (NetworkFunctionRoleInstanceListResult, error)) NetworkFunctionRoleInstanceListResultPage { 982 return NetworkFunctionRoleInstanceListResultPage{ 983 fn: getNextPage, 984 nfrilr: cur, 985 } 986} 987 988// NetworkFunctionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 989// long-running operation. 990type NetworkFunctionsCreateOrUpdateFuture struct { 991 azure.FutureAPI 992 // Result returns the result of the asynchronous operation. 993 // If the operation has not completed it will return an error. 994 Result func(NetworkFunctionsClient) (NetworkFunction, error) 995} 996 997// NetworkFunctionsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 998// operation. 999type NetworkFunctionsDeleteFuture struct { 1000 azure.FutureAPI 1001 // Result returns the result of the asynchronous operation. 1002 // If the operation has not completed it will return an error. 1003 Result func(NetworkFunctionsClient) (autorest.Response, error) 1004} 1005 1006// NetworkFunctionSkuDetails the network function sku details. 1007type NetworkFunctionSkuDetails struct { 1008 autorest.Response `json:"-"` 1009 // SkuType - The network function sku type. Possible values include: 'SkuTypeUnknown', 'SkuTypeEvolvedPacketCore', 'SkuTypeSDWAN', 'SkuTypeFirewall' 1010 SkuType SkuType `json:"skuType,omitempty"` 1011 // Value - The network function sku role details. 1012 Value *[]NetworkFunctionSkuRoleDetails `json:"value,omitempty"` 1013 // NextLink - READ-ONLY; The URL to get the next set of results. 1014 NextLink *string `json:"nextLink,omitempty"` 1015} 1016 1017// MarshalJSON is the custom marshaler for NetworkFunctionSkuDetails. 1018func (nfsd NetworkFunctionSkuDetails) MarshalJSON() ([]byte, error) { 1019 objectMap := make(map[string]interface{}) 1020 if nfsd.SkuType != "" { 1021 objectMap["skuType"] = nfsd.SkuType 1022 } 1023 if nfsd.Value != nil { 1024 objectMap["value"] = nfsd.Value 1025 } 1026 return json.Marshal(objectMap) 1027} 1028 1029// NetworkFunctionSkuDetailsIterator provides access to a complete listing of NetworkFunctionSkuRoleDetails 1030// values. 1031type NetworkFunctionSkuDetailsIterator struct { 1032 i int 1033 page NetworkFunctionSkuDetailsPage 1034} 1035 1036// NextWithContext advances to the next value. If there was an error making 1037// the request the iterator does not advance and the error is returned. 1038func (iter *NetworkFunctionSkuDetailsIterator) NextWithContext(ctx context.Context) (err error) { 1039 if tracing.IsEnabled() { 1040 ctx = tracing.StartSpan(ctx, fqdn+"/NetworkFunctionSkuDetailsIterator.NextWithContext") 1041 defer func() { 1042 sc := -1 1043 if iter.Response().Response.Response != nil { 1044 sc = iter.Response().Response.Response.StatusCode 1045 } 1046 tracing.EndSpan(ctx, sc, err) 1047 }() 1048 } 1049 iter.i++ 1050 if iter.i < len(iter.page.Values()) { 1051 return nil 1052 } 1053 err = iter.page.NextWithContext(ctx) 1054 if err != nil { 1055 iter.i-- 1056 return err 1057 } 1058 iter.i = 0 1059 return nil 1060} 1061 1062// Next advances to the next value. If there was an error making 1063// the request the iterator does not advance and the error is returned. 1064// Deprecated: Use NextWithContext() instead. 1065func (iter *NetworkFunctionSkuDetailsIterator) Next() error { 1066 return iter.NextWithContext(context.Background()) 1067} 1068 1069// NotDone returns true if the enumeration should be started or is not yet complete. 1070func (iter NetworkFunctionSkuDetailsIterator) NotDone() bool { 1071 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1072} 1073 1074// Response returns the raw server response from the last page request. 1075func (iter NetworkFunctionSkuDetailsIterator) Response() NetworkFunctionSkuDetails { 1076 return iter.page.Response() 1077} 1078 1079// Value returns the current value or a zero-initialized value if the 1080// iterator has advanced beyond the end of the collection. 1081func (iter NetworkFunctionSkuDetailsIterator) Value() NetworkFunctionSkuRoleDetails { 1082 if !iter.page.NotDone() { 1083 return NetworkFunctionSkuRoleDetails{} 1084 } 1085 return iter.page.Values()[iter.i] 1086} 1087 1088// Creates a new instance of the NetworkFunctionSkuDetailsIterator type. 1089func NewNetworkFunctionSkuDetailsIterator(page NetworkFunctionSkuDetailsPage) NetworkFunctionSkuDetailsIterator { 1090 return NetworkFunctionSkuDetailsIterator{page: page} 1091} 1092 1093// IsEmpty returns true if the ListResult contains no values. 1094func (nfsd NetworkFunctionSkuDetails) IsEmpty() bool { 1095 return nfsd.Value == nil || len(*nfsd.Value) == 0 1096} 1097 1098// hasNextLink returns true if the NextLink is not empty. 1099func (nfsd NetworkFunctionSkuDetails) hasNextLink() bool { 1100 return nfsd.NextLink != nil && len(*nfsd.NextLink) != 0 1101} 1102 1103// networkFunctionSkuDetailsPreparer prepares a request to retrieve the next set of results. 1104// It returns nil if no more results exist. 1105func (nfsd NetworkFunctionSkuDetails) networkFunctionSkuDetailsPreparer(ctx context.Context) (*http.Request, error) { 1106 if !nfsd.hasNextLink() { 1107 return nil, nil 1108 } 1109 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1110 autorest.AsJSON(), 1111 autorest.AsGet(), 1112 autorest.WithBaseURL(to.String(nfsd.NextLink))) 1113} 1114 1115// NetworkFunctionSkuDetailsPage contains a page of NetworkFunctionSkuRoleDetails values. 1116type NetworkFunctionSkuDetailsPage struct { 1117 fn func(context.Context, NetworkFunctionSkuDetails) (NetworkFunctionSkuDetails, error) 1118 nfsd NetworkFunctionSkuDetails 1119} 1120 1121// NextWithContext advances to the next page of values. If there was an error making 1122// the request the page does not advance and the error is returned. 1123func (page *NetworkFunctionSkuDetailsPage) NextWithContext(ctx context.Context) (err error) { 1124 if tracing.IsEnabled() { 1125 ctx = tracing.StartSpan(ctx, fqdn+"/NetworkFunctionSkuDetailsPage.NextWithContext") 1126 defer func() { 1127 sc := -1 1128 if page.Response().Response.Response != nil { 1129 sc = page.Response().Response.Response.StatusCode 1130 } 1131 tracing.EndSpan(ctx, sc, err) 1132 }() 1133 } 1134 for { 1135 next, err := page.fn(ctx, page.nfsd) 1136 if err != nil { 1137 return err 1138 } 1139 page.nfsd = next 1140 if !next.hasNextLink() || !next.IsEmpty() { 1141 break 1142 } 1143 } 1144 return nil 1145} 1146 1147// Next advances to the next page of values. If there was an error making 1148// the request the page does not advance and the error is returned. 1149// Deprecated: Use NextWithContext() instead. 1150func (page *NetworkFunctionSkuDetailsPage) Next() error { 1151 return page.NextWithContext(context.Background()) 1152} 1153 1154// NotDone returns true if the page enumeration should be started or is not yet complete. 1155func (page NetworkFunctionSkuDetailsPage) NotDone() bool { 1156 return !page.nfsd.IsEmpty() 1157} 1158 1159// Response returns the raw server response from the last page request. 1160func (page NetworkFunctionSkuDetailsPage) Response() NetworkFunctionSkuDetails { 1161 return page.nfsd 1162} 1163 1164// Values returns the slice of values for the current page or nil if there are no values. 1165func (page NetworkFunctionSkuDetailsPage) Values() []NetworkFunctionSkuRoleDetails { 1166 if page.nfsd.IsEmpty() { 1167 return nil 1168 } 1169 return *page.nfsd.Value 1170} 1171 1172// Creates a new instance of the NetworkFunctionSkuDetailsPage type. 1173func NewNetworkFunctionSkuDetailsPage(cur NetworkFunctionSkuDetails, getNextPage func(context.Context, NetworkFunctionSkuDetails) (NetworkFunctionSkuDetails, error)) NetworkFunctionSkuDetailsPage { 1174 return NetworkFunctionSkuDetailsPage{ 1175 fn: getNextPage, 1176 nfsd: cur, 1177 } 1178} 1179 1180// NetworkFunctionSkuListResult a list of available network function skus. 1181type NetworkFunctionSkuListResult struct { 1182 autorest.Response `json:"-"` 1183 // Value - The network function vendor sku overview properties. 1184 Value *[]SkuOverview `json:"value,omitempty"` 1185 // NextLink - READ-ONLY; The URL to get the next set of results. 1186 NextLink *string `json:"nextLink,omitempty"` 1187} 1188 1189// MarshalJSON is the custom marshaler for NetworkFunctionSkuListResult. 1190func (nfslr NetworkFunctionSkuListResult) MarshalJSON() ([]byte, error) { 1191 objectMap := make(map[string]interface{}) 1192 if nfslr.Value != nil { 1193 objectMap["value"] = nfslr.Value 1194 } 1195 return json.Marshal(objectMap) 1196} 1197 1198// NetworkFunctionSkuListResultIterator provides access to a complete listing of SkuOverview values. 1199type NetworkFunctionSkuListResultIterator struct { 1200 i int 1201 page NetworkFunctionSkuListResultPage 1202} 1203 1204// NextWithContext advances to the next value. If there was an error making 1205// the request the iterator does not advance and the error is returned. 1206func (iter *NetworkFunctionSkuListResultIterator) NextWithContext(ctx context.Context) (err error) { 1207 if tracing.IsEnabled() { 1208 ctx = tracing.StartSpan(ctx, fqdn+"/NetworkFunctionSkuListResultIterator.NextWithContext") 1209 defer func() { 1210 sc := -1 1211 if iter.Response().Response.Response != nil { 1212 sc = iter.Response().Response.Response.StatusCode 1213 } 1214 tracing.EndSpan(ctx, sc, err) 1215 }() 1216 } 1217 iter.i++ 1218 if iter.i < len(iter.page.Values()) { 1219 return nil 1220 } 1221 err = iter.page.NextWithContext(ctx) 1222 if err != nil { 1223 iter.i-- 1224 return err 1225 } 1226 iter.i = 0 1227 return nil 1228} 1229 1230// Next advances to the next value. If there was an error making 1231// the request the iterator does not advance and the error is returned. 1232// Deprecated: Use NextWithContext() instead. 1233func (iter *NetworkFunctionSkuListResultIterator) Next() error { 1234 return iter.NextWithContext(context.Background()) 1235} 1236 1237// NotDone returns true if the enumeration should be started or is not yet complete. 1238func (iter NetworkFunctionSkuListResultIterator) NotDone() bool { 1239 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1240} 1241 1242// Response returns the raw server response from the last page request. 1243func (iter NetworkFunctionSkuListResultIterator) Response() NetworkFunctionSkuListResult { 1244 return iter.page.Response() 1245} 1246 1247// Value returns the current value or a zero-initialized value if the 1248// iterator has advanced beyond the end of the collection. 1249func (iter NetworkFunctionSkuListResultIterator) Value() SkuOverview { 1250 if !iter.page.NotDone() { 1251 return SkuOverview{} 1252 } 1253 return iter.page.Values()[iter.i] 1254} 1255 1256// Creates a new instance of the NetworkFunctionSkuListResultIterator type. 1257func NewNetworkFunctionSkuListResultIterator(page NetworkFunctionSkuListResultPage) NetworkFunctionSkuListResultIterator { 1258 return NetworkFunctionSkuListResultIterator{page: page} 1259} 1260 1261// IsEmpty returns true if the ListResult contains no values. 1262func (nfslr NetworkFunctionSkuListResult) IsEmpty() bool { 1263 return nfslr.Value == nil || len(*nfslr.Value) == 0 1264} 1265 1266// hasNextLink returns true if the NextLink is not empty. 1267func (nfslr NetworkFunctionSkuListResult) hasNextLink() bool { 1268 return nfslr.NextLink != nil && len(*nfslr.NextLink) != 0 1269} 1270 1271// networkFunctionSkuListResultPreparer prepares a request to retrieve the next set of results. 1272// It returns nil if no more results exist. 1273func (nfslr NetworkFunctionSkuListResult) networkFunctionSkuListResultPreparer(ctx context.Context) (*http.Request, error) { 1274 if !nfslr.hasNextLink() { 1275 return nil, nil 1276 } 1277 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1278 autorest.AsJSON(), 1279 autorest.AsGet(), 1280 autorest.WithBaseURL(to.String(nfslr.NextLink))) 1281} 1282 1283// NetworkFunctionSkuListResultPage contains a page of SkuOverview values. 1284type NetworkFunctionSkuListResultPage struct { 1285 fn func(context.Context, NetworkFunctionSkuListResult) (NetworkFunctionSkuListResult, error) 1286 nfslr NetworkFunctionSkuListResult 1287} 1288 1289// NextWithContext advances to the next page of values. If there was an error making 1290// the request the page does not advance and the error is returned. 1291func (page *NetworkFunctionSkuListResultPage) NextWithContext(ctx context.Context) (err error) { 1292 if tracing.IsEnabled() { 1293 ctx = tracing.StartSpan(ctx, fqdn+"/NetworkFunctionSkuListResultPage.NextWithContext") 1294 defer func() { 1295 sc := -1 1296 if page.Response().Response.Response != nil { 1297 sc = page.Response().Response.Response.StatusCode 1298 } 1299 tracing.EndSpan(ctx, sc, err) 1300 }() 1301 } 1302 for { 1303 next, err := page.fn(ctx, page.nfslr) 1304 if err != nil { 1305 return err 1306 } 1307 page.nfslr = next 1308 if !next.hasNextLink() || !next.IsEmpty() { 1309 break 1310 } 1311 } 1312 return nil 1313} 1314 1315// Next advances to the next page of values. If there was an error making 1316// the request the page does not advance and the error is returned. 1317// Deprecated: Use NextWithContext() instead. 1318func (page *NetworkFunctionSkuListResultPage) Next() error { 1319 return page.NextWithContext(context.Background()) 1320} 1321 1322// NotDone returns true if the page enumeration should be started or is not yet complete. 1323func (page NetworkFunctionSkuListResultPage) NotDone() bool { 1324 return !page.nfslr.IsEmpty() 1325} 1326 1327// Response returns the raw server response from the last page request. 1328func (page NetworkFunctionSkuListResultPage) Response() NetworkFunctionSkuListResult { 1329 return page.nfslr 1330} 1331 1332// Values returns the slice of values for the current page or nil if there are no values. 1333func (page NetworkFunctionSkuListResultPage) Values() []SkuOverview { 1334 if page.nfslr.IsEmpty() { 1335 return nil 1336 } 1337 return *page.nfslr.Value 1338} 1339 1340// Creates a new instance of the NetworkFunctionSkuListResultPage type. 1341func NewNetworkFunctionSkuListResultPage(cur NetworkFunctionSkuListResult, getNextPage func(context.Context, NetworkFunctionSkuListResult) (NetworkFunctionSkuListResult, error)) NetworkFunctionSkuListResultPage { 1342 return NetworkFunctionSkuListResultPage{ 1343 fn: getNextPage, 1344 nfslr: cur, 1345 } 1346} 1347 1348// NetworkFunctionSkuRoleDetails the network function user configuration. 1349type NetworkFunctionSkuRoleDetails struct { 1350 // RoleName - The name of the network function role. 1351 RoleName *string `json:"roleName,omitempty"` 1352 // UserDataTemplate - The user data template for customers. 1353 UserDataTemplate interface{} `json:"userDataTemplate,omitempty"` 1354 // UserDataParameters - The user parameters for customers. 1355 UserDataParameters interface{} `json:"userDataParameters,omitempty"` 1356 // NetworkInterfaces - The network interface configuration. 1357 NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` 1358} 1359 1360// NetworkFunctionTemplate the network function template. 1361type NetworkFunctionTemplate struct { 1362 // NetworkFunctionRoleConfigurations - An array of network function role definitions. 1363 NetworkFunctionRoleConfigurations *[]NetworkFunctionRoleConfiguration `json:"networkFunctionRoleConfigurations,omitempty"` 1364} 1365 1366// NetworkFunctionUserConfiguration the network function user configuration. 1367type NetworkFunctionUserConfiguration struct { 1368 // RoleName - The name of the network function role. 1369 RoleName *string `json:"roleName,omitempty"` 1370 // UserDataParameters - The user data parameters from the customer. 1371 UserDataParameters interface{} `json:"userDataParameters,omitempty"` 1372 // NetworkInterfaces - The network interface configuration. 1373 NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` 1374 // OsProfile - Specifies the operating system settings for the role instance. 1375 OsProfile *NetworkFunctionUserConfigurationOsProfile `json:"osProfile,omitempty"` 1376} 1377 1378// NetworkFunctionUserConfigurationOsProfile specifies the operating system settings for the role instance. 1379type NetworkFunctionUserConfigurationOsProfile struct { 1380 // CustomData - Specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that is saved as a file on the virtual machine. The maximum length of the binary array is 65535 bytes. <br><br> **Note: Do not pass any secrets or passwords in customData property** <br><br> This property cannot be updated after the VM is created. <br><br> customData is passed to the VM to be saved as a file. For more information see [Custom Data on Azure VMs](https://azure.microsoft.com/en-us/blog/custom-data-and-cloud-init-on-windows-azure/) <br><br> For using cloud-init for your Linux VM, see [Using cloud-init to customize a Linux VM during creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) 1381 CustomData *string `json:"customData,omitempty"` 1382} 1383 1384// NetworkFunctionVendor the network function vendor. 1385type NetworkFunctionVendor struct { 1386 // VendorDetails - Vendors of Hybrid Network service provider. 1387 *VendorDetails `json:"properties,omitempty"` 1388} 1389 1390// MarshalJSON is the custom marshaler for NetworkFunctionVendor. 1391func (nfv NetworkFunctionVendor) MarshalJSON() ([]byte, error) { 1392 objectMap := make(map[string]interface{}) 1393 if nfv.VendorDetails != nil { 1394 objectMap["properties"] = nfv.VendorDetails 1395 } 1396 return json.Marshal(objectMap) 1397} 1398 1399// UnmarshalJSON is the custom unmarshaler for NetworkFunctionVendor struct. 1400func (nfv *NetworkFunctionVendor) UnmarshalJSON(body []byte) error { 1401 var m map[string]*json.RawMessage 1402 err := json.Unmarshal(body, &m) 1403 if err != nil { 1404 return err 1405 } 1406 for k, v := range m { 1407 switch k { 1408 case "properties": 1409 if v != nil { 1410 var vendorDetails VendorDetails 1411 err = json.Unmarshal(*v, &vendorDetails) 1412 if err != nil { 1413 return err 1414 } 1415 nfv.VendorDetails = &vendorDetails 1416 } 1417 } 1418 } 1419 1420 return nil 1421} 1422 1423// NetworkFunctionVendorConfiguration network function vendor configuration. 1424type NetworkFunctionVendorConfiguration struct { 1425 // RoleName - The name of the vendor network function role. 1426 RoleName *string `json:"roleName,omitempty"` 1427 // OsProfile - Specifies the operating system settings for the role instance. 1428 OsProfile *OsProfile `json:"osProfile,omitempty"` 1429 // UserDataParameters - READ-ONLY; The user parameters from the customer. 1430 UserDataParameters interface{} `json:"userDataParameters,omitempty"` 1431 // NetworkInterfaces - The network interface configurations. 1432 NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` 1433} 1434 1435// MarshalJSON is the custom marshaler for NetworkFunctionVendorConfiguration. 1436func (nfvc NetworkFunctionVendorConfiguration) MarshalJSON() ([]byte, error) { 1437 objectMap := make(map[string]interface{}) 1438 if nfvc.RoleName != nil { 1439 objectMap["roleName"] = nfvc.RoleName 1440 } 1441 if nfvc.OsProfile != nil { 1442 objectMap["osProfile"] = nfvc.OsProfile 1443 } 1444 if nfvc.NetworkInterfaces != nil { 1445 objectMap["networkInterfaces"] = nfvc.NetworkInterfaces 1446 } 1447 return json.Marshal(objectMap) 1448} 1449 1450// NetworkFunctionVendorListResult the network function vendor list result. 1451type NetworkFunctionVendorListResult struct { 1452 autorest.Response `json:"-"` 1453 // Value - A list of available network function vendors and skus. 1454 Value *[]NetworkFunctionVendor `json:"value,omitempty"` 1455 // NextLink - READ-ONLY; The URL to get the next set of results. 1456 NextLink *string `json:"nextLink,omitempty"` 1457} 1458 1459// MarshalJSON is the custom marshaler for NetworkFunctionVendorListResult. 1460func (nfvlr NetworkFunctionVendorListResult) MarshalJSON() ([]byte, error) { 1461 objectMap := make(map[string]interface{}) 1462 if nfvlr.Value != nil { 1463 objectMap["value"] = nfvlr.Value 1464 } 1465 return json.Marshal(objectMap) 1466} 1467 1468// NetworkFunctionVendorListResultIterator provides access to a complete listing of NetworkFunctionVendor 1469// values. 1470type NetworkFunctionVendorListResultIterator struct { 1471 i int 1472 page NetworkFunctionVendorListResultPage 1473} 1474 1475// NextWithContext advances to the next value. If there was an error making 1476// the request the iterator does not advance and the error is returned. 1477func (iter *NetworkFunctionVendorListResultIterator) NextWithContext(ctx context.Context) (err error) { 1478 if tracing.IsEnabled() { 1479 ctx = tracing.StartSpan(ctx, fqdn+"/NetworkFunctionVendorListResultIterator.NextWithContext") 1480 defer func() { 1481 sc := -1 1482 if iter.Response().Response.Response != nil { 1483 sc = iter.Response().Response.Response.StatusCode 1484 } 1485 tracing.EndSpan(ctx, sc, err) 1486 }() 1487 } 1488 iter.i++ 1489 if iter.i < len(iter.page.Values()) { 1490 return nil 1491 } 1492 err = iter.page.NextWithContext(ctx) 1493 if err != nil { 1494 iter.i-- 1495 return err 1496 } 1497 iter.i = 0 1498 return nil 1499} 1500 1501// Next advances to the next value. If there was an error making 1502// the request the iterator does not advance and the error is returned. 1503// Deprecated: Use NextWithContext() instead. 1504func (iter *NetworkFunctionVendorListResultIterator) Next() error { 1505 return iter.NextWithContext(context.Background()) 1506} 1507 1508// NotDone returns true if the enumeration should be started or is not yet complete. 1509func (iter NetworkFunctionVendorListResultIterator) NotDone() bool { 1510 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1511} 1512 1513// Response returns the raw server response from the last page request. 1514func (iter NetworkFunctionVendorListResultIterator) Response() NetworkFunctionVendorListResult { 1515 return iter.page.Response() 1516} 1517 1518// Value returns the current value or a zero-initialized value if the 1519// iterator has advanced beyond the end of the collection. 1520func (iter NetworkFunctionVendorListResultIterator) Value() NetworkFunctionVendor { 1521 if !iter.page.NotDone() { 1522 return NetworkFunctionVendor{} 1523 } 1524 return iter.page.Values()[iter.i] 1525} 1526 1527// Creates a new instance of the NetworkFunctionVendorListResultIterator type. 1528func NewNetworkFunctionVendorListResultIterator(page NetworkFunctionVendorListResultPage) NetworkFunctionVendorListResultIterator { 1529 return NetworkFunctionVendorListResultIterator{page: page} 1530} 1531 1532// IsEmpty returns true if the ListResult contains no values. 1533func (nfvlr NetworkFunctionVendorListResult) IsEmpty() bool { 1534 return nfvlr.Value == nil || len(*nfvlr.Value) == 0 1535} 1536 1537// hasNextLink returns true if the NextLink is not empty. 1538func (nfvlr NetworkFunctionVendorListResult) hasNextLink() bool { 1539 return nfvlr.NextLink != nil && len(*nfvlr.NextLink) != 0 1540} 1541 1542// networkFunctionVendorListResultPreparer prepares a request to retrieve the next set of results. 1543// It returns nil if no more results exist. 1544func (nfvlr NetworkFunctionVendorListResult) networkFunctionVendorListResultPreparer(ctx context.Context) (*http.Request, error) { 1545 if !nfvlr.hasNextLink() { 1546 return nil, nil 1547 } 1548 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1549 autorest.AsJSON(), 1550 autorest.AsGet(), 1551 autorest.WithBaseURL(to.String(nfvlr.NextLink))) 1552} 1553 1554// NetworkFunctionVendorListResultPage contains a page of NetworkFunctionVendor values. 1555type NetworkFunctionVendorListResultPage struct { 1556 fn func(context.Context, NetworkFunctionVendorListResult) (NetworkFunctionVendorListResult, error) 1557 nfvlr NetworkFunctionVendorListResult 1558} 1559 1560// NextWithContext advances to the next page of values. If there was an error making 1561// the request the page does not advance and the error is returned. 1562func (page *NetworkFunctionVendorListResultPage) NextWithContext(ctx context.Context) (err error) { 1563 if tracing.IsEnabled() { 1564 ctx = tracing.StartSpan(ctx, fqdn+"/NetworkFunctionVendorListResultPage.NextWithContext") 1565 defer func() { 1566 sc := -1 1567 if page.Response().Response.Response != nil { 1568 sc = page.Response().Response.Response.StatusCode 1569 } 1570 tracing.EndSpan(ctx, sc, err) 1571 }() 1572 } 1573 for { 1574 next, err := page.fn(ctx, page.nfvlr) 1575 if err != nil { 1576 return err 1577 } 1578 page.nfvlr = next 1579 if !next.hasNextLink() || !next.IsEmpty() { 1580 break 1581 } 1582 } 1583 return nil 1584} 1585 1586// Next advances to the next page of values. If there was an error making 1587// the request the page does not advance and the error is returned. 1588// Deprecated: Use NextWithContext() instead. 1589func (page *NetworkFunctionVendorListResultPage) Next() error { 1590 return page.NextWithContext(context.Background()) 1591} 1592 1593// NotDone returns true if the page enumeration should be started or is not yet complete. 1594func (page NetworkFunctionVendorListResultPage) NotDone() bool { 1595 return !page.nfvlr.IsEmpty() 1596} 1597 1598// Response returns the raw server response from the last page request. 1599func (page NetworkFunctionVendorListResultPage) Response() NetworkFunctionVendorListResult { 1600 return page.nfvlr 1601} 1602 1603// Values returns the slice of values for the current page or nil if there are no values. 1604func (page NetworkFunctionVendorListResultPage) Values() []NetworkFunctionVendor { 1605 if page.nfvlr.IsEmpty() { 1606 return nil 1607 } 1608 return *page.nfvlr.Value 1609} 1610 1611// Creates a new instance of the NetworkFunctionVendorListResultPage type. 1612func NewNetworkFunctionVendorListResultPage(cur NetworkFunctionVendorListResult, getNextPage func(context.Context, NetworkFunctionVendorListResult) (NetworkFunctionVendorListResult, error)) NetworkFunctionVendorListResultPage { 1613 return NetworkFunctionVendorListResultPage{ 1614 fn: getNextPage, 1615 nfvlr: cur, 1616 } 1617} 1618 1619// NetworkInterface network interface properties. 1620type NetworkInterface struct { 1621 // NetworkInterfaceName - The name of the network interface. 1622 NetworkInterfaceName *string `json:"networkInterfaceName,omitempty"` 1623 // MacAddress - The MAC address of the network interface. 1624 MacAddress *string `json:"macAddress,omitempty"` 1625 // IPConfigurations - A list of IP configurations of the network interface. 1626 IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` 1627 // VMSwitchType - The type of the VM switch. Possible values include: 'VMSwitchTypeUnknown', 'VMSwitchTypeManagement', 'VMSwitchTypeWan', 'VMSwitchTypeLan' 1628 VMSwitchType VMSwitchType `json:"vmSwitchType,omitempty"` 1629} 1630 1631// NetworkInterfaceIPConfiguration network interface IP configuration properties. 1632type NetworkInterfaceIPConfiguration struct { 1633 // IPAllocationMethod - IP address allocation method. Possible values include: 'IPAllocationMethodUnknown', 'IPAllocationMethodStatic', 'IPAllocationMethodDynamic' 1634 IPAllocationMethod IPAllocationMethod `json:"ipAllocationMethod,omitempty"` 1635 // IPAddress - The value of the IP address. 1636 IPAddress *string `json:"ipAddress,omitempty"` 1637 // Subnet - The value of the subnet. 1638 Subnet *string `json:"subnet,omitempty"` 1639 // Gateway - The value of the gateway. 1640 Gateway *string `json:"gateway,omitempty"` 1641 // IPVersion - IP address version. Possible values include: 'IPVersionUnknown', 'IPVersionIPv4' 1642 IPVersion IPVersion `json:"ipVersion,omitempty"` 1643 // DNSServers - The list of DNS servers IP addresses. 1644 DNSServers *[]string `json:"dnsServers,omitempty"` 1645} 1646 1647// Operation object that describes a single Microsoft.HybridNetwork operation. 1648type Operation struct { 1649 // Name - READ-ONLY; Operation name: {provider}/{resource}/{operation}. 1650 Name *string `json:"name,omitempty"` 1651 // Display - READ-ONLY; The object that represents the operation. 1652 Display *OperationDisplay `json:"display,omitempty"` 1653} 1654 1655// OperationDisplay the object that represents the operation. 1656type OperationDisplay struct { 1657 // Provider - Service provider: Microsoft.HybridNetwork. 1658 Provider *string `json:"provider,omitempty"` 1659 // Resource - Resource on which the operation is performed: Registration definition, registration assignment, etc. 1660 Resource *string `json:"resource,omitempty"` 1661 // Operation - Operation type: Read, write, delete, etc. 1662 Operation *string `json:"operation,omitempty"` 1663 // Description - Description of the operation. 1664 Description *string `json:"description,omitempty"` 1665} 1666 1667// OperationList a list of the operations. 1668type OperationList struct { 1669 autorest.Response `json:"-"` 1670 // Value - READ-ONLY; A list of Microsoft.HybridNetwork operations. 1671 Value *[]Operation `json:"value,omitempty"` 1672 // NextLink - READ-ONLY; The URL to get the next set of results. 1673 NextLink *string `json:"nextLink,omitempty"` 1674} 1675 1676// OperationListIterator provides access to a complete listing of Operation values. 1677type OperationListIterator struct { 1678 i int 1679 page OperationListPage 1680} 1681 1682// NextWithContext advances to the next value. If there was an error making 1683// the request the iterator does not advance and the error is returned. 1684func (iter *OperationListIterator) NextWithContext(ctx context.Context) (err error) { 1685 if tracing.IsEnabled() { 1686 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListIterator.NextWithContext") 1687 defer func() { 1688 sc := -1 1689 if iter.Response().Response.Response != nil { 1690 sc = iter.Response().Response.Response.StatusCode 1691 } 1692 tracing.EndSpan(ctx, sc, err) 1693 }() 1694 } 1695 iter.i++ 1696 if iter.i < len(iter.page.Values()) { 1697 return nil 1698 } 1699 err = iter.page.NextWithContext(ctx) 1700 if err != nil { 1701 iter.i-- 1702 return err 1703 } 1704 iter.i = 0 1705 return nil 1706} 1707 1708// Next advances to the next value. If there was an error making 1709// the request the iterator does not advance and the error is returned. 1710// Deprecated: Use NextWithContext() instead. 1711func (iter *OperationListIterator) Next() error { 1712 return iter.NextWithContext(context.Background()) 1713} 1714 1715// NotDone returns true if the enumeration should be started or is not yet complete. 1716func (iter OperationListIterator) NotDone() bool { 1717 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1718} 1719 1720// Response returns the raw server response from the last page request. 1721func (iter OperationListIterator) Response() OperationList { 1722 return iter.page.Response() 1723} 1724 1725// Value returns the current value or a zero-initialized value if the 1726// iterator has advanced beyond the end of the collection. 1727func (iter OperationListIterator) Value() Operation { 1728 if !iter.page.NotDone() { 1729 return Operation{} 1730 } 1731 return iter.page.Values()[iter.i] 1732} 1733 1734// Creates a new instance of the OperationListIterator type. 1735func NewOperationListIterator(page OperationListPage) OperationListIterator { 1736 return OperationListIterator{page: page} 1737} 1738 1739// IsEmpty returns true if the ListResult contains no values. 1740func (ol OperationList) IsEmpty() bool { 1741 return ol.Value == nil || len(*ol.Value) == 0 1742} 1743 1744// hasNextLink returns true if the NextLink is not empty. 1745func (ol OperationList) hasNextLink() bool { 1746 return ol.NextLink != nil && len(*ol.NextLink) != 0 1747} 1748 1749// operationListPreparer prepares a request to retrieve the next set of results. 1750// It returns nil if no more results exist. 1751func (ol OperationList) operationListPreparer(ctx context.Context) (*http.Request, error) { 1752 if !ol.hasNextLink() { 1753 return nil, nil 1754 } 1755 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1756 autorest.AsJSON(), 1757 autorest.AsGet(), 1758 autorest.WithBaseURL(to.String(ol.NextLink))) 1759} 1760 1761// OperationListPage contains a page of Operation values. 1762type OperationListPage struct { 1763 fn func(context.Context, OperationList) (OperationList, error) 1764 ol OperationList 1765} 1766 1767// NextWithContext advances to the next page of values. If there was an error making 1768// the request the page does not advance and the error is returned. 1769func (page *OperationListPage) NextWithContext(ctx context.Context) (err error) { 1770 if tracing.IsEnabled() { 1771 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListPage.NextWithContext") 1772 defer func() { 1773 sc := -1 1774 if page.Response().Response.Response != nil { 1775 sc = page.Response().Response.Response.StatusCode 1776 } 1777 tracing.EndSpan(ctx, sc, err) 1778 }() 1779 } 1780 for { 1781 next, err := page.fn(ctx, page.ol) 1782 if err != nil { 1783 return err 1784 } 1785 page.ol = next 1786 if !next.hasNextLink() || !next.IsEmpty() { 1787 break 1788 } 1789 } 1790 return nil 1791} 1792 1793// Next advances to the next page of values. If there was an error making 1794// the request the page does not advance and the error is returned. 1795// Deprecated: Use NextWithContext() instead. 1796func (page *OperationListPage) Next() error { 1797 return page.NextWithContext(context.Background()) 1798} 1799 1800// NotDone returns true if the page enumeration should be started or is not yet complete. 1801func (page OperationListPage) NotDone() bool { 1802 return !page.ol.IsEmpty() 1803} 1804 1805// Response returns the raw server response from the last page request. 1806func (page OperationListPage) Response() OperationList { 1807 return page.ol 1808} 1809 1810// Values returns the slice of values for the current page or nil if there are no values. 1811func (page OperationListPage) Values() []Operation { 1812 if page.ol.IsEmpty() { 1813 return nil 1814 } 1815 return *page.ol.Value 1816} 1817 1818// Creates a new instance of the OperationListPage type. 1819func NewOperationListPage(cur OperationList, getNextPage func(context.Context, OperationList) (OperationList, error)) OperationListPage { 1820 return OperationListPage{ 1821 fn: getNextPage, 1822 ol: cur, 1823 } 1824} 1825 1826// OsDisk specifies information about the operating system disk used by the virtual machine. <br><br> For 1827// more information about disks, see [About disks and VHDs for Azure virtual 1828// machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). 1829type OsDisk struct { 1830 // OsType - The OS type. Possible values include: 'OperatingSystemTypesUnknown', 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' 1831 OsType OperatingSystemTypes `json:"osType,omitempty"` 1832 // Name - The VHD name. 1833 Name *string `json:"name,omitempty"` 1834 // Vhd - The virtual hard disk. 1835 Vhd *VirtualHardDisk `json:"vhd,omitempty"` 1836 // DiskSizeGB - Specifies the size of os disk in gigabytes. This is the fully expanded disk size needed of the VHD image on the ASE. This disk size should be greater than the size of the VHD provided in vhdUri. 1837 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 1838} 1839 1840// OsProfile specifies the operating system settings for the role instance. 1841type OsProfile struct { 1842 // AdminUsername - Specifies the name of the administrator account. <br><br> **Windows-only restriction:** Cannot end in "." <br><br> **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". <br><br> **Minimum-length (Linux):** 1 character <br><br> **Max-length (Linux):** 64 characters <br><br> **Max-length (Windows):** 20 characters <br><br><li> For root access to the Linux VM, see [Using root privileges on Linux virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)<br><li> For a list of built-in system users on Linux that should not be used in this field, see [Selecting User Names for Linux on Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). 1843 AdminUsername *string `json:"adminUsername,omitempty"` 1844 // LinuxConfiguration - Specifies the Linux operating system settings on the virtual machine. <br><br>For a list of supported Linux distributions, see [Linux on Azure-Endorsed Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) <br><br> For running non-endorsed distributions, see [Information for Non-Endorsed Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). 1845 LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` 1846 // CustomData - Specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that is saved as a file on the virtual machine. The maximum length of the binary array is 65535 bytes. <br><br> **Note: Do not pass any secrets or passwords in customData property** <br><br> This property cannot be updated after the VM is created. <br><br> customData is passed to the VM to be saved as a file. For more information see [Custom Data on Azure VMs](https://azure.microsoft.com/en-us/blog/custom-data-and-cloud-init-on-windows-azure/) <br><br> For using cloud-init for your Linux VM, see [Using cloud-init to customize a Linux VM during creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) 1847 CustomData *string `json:"customData,omitempty"` 1848 // CustomDataRequired - Indicates if custom data is required to deploy this role. 1849 CustomDataRequired *bool `json:"customDataRequired,omitempty"` 1850} 1851 1852// PreviewSubscription customer subscription which can use a sku. 1853type PreviewSubscription struct { 1854 autorest.Response `json:"-"` 1855 // Name - READ-ONLY; The preview subscription ID. 1856 Name *string `json:"name,omitempty"` 1857 // ID - READ-ONLY; The ARM ID of the resource. 1858 ID *string `json:"id,omitempty"` 1859 // Type - READ-ONLY; The type of the resource. 1860 Type *string `json:"type,omitempty"` 1861} 1862 1863// PreviewSubscriptionsList a list of customer subscriptions which can use a sku. 1864type PreviewSubscriptionsList struct { 1865 autorest.Response `json:"-"` 1866 // Value - A list of preview subscriptions. 1867 Value *[]PreviewSubscription `json:"value,omitempty"` 1868 // NextLink - READ-ONLY; The URL to get the next set of results. 1869 NextLink *string `json:"nextLink,omitempty"` 1870} 1871 1872// MarshalJSON is the custom marshaler for PreviewSubscriptionsList. 1873func (psl PreviewSubscriptionsList) MarshalJSON() ([]byte, error) { 1874 objectMap := make(map[string]interface{}) 1875 if psl.Value != nil { 1876 objectMap["value"] = psl.Value 1877 } 1878 return json.Marshal(objectMap) 1879} 1880 1881// PreviewSubscriptionsListIterator provides access to a complete listing of PreviewSubscription values. 1882type PreviewSubscriptionsListIterator struct { 1883 i int 1884 page PreviewSubscriptionsListPage 1885} 1886 1887// NextWithContext advances to the next value. If there was an error making 1888// the request the iterator does not advance and the error is returned. 1889func (iter *PreviewSubscriptionsListIterator) NextWithContext(ctx context.Context) (err error) { 1890 if tracing.IsEnabled() { 1891 ctx = tracing.StartSpan(ctx, fqdn+"/PreviewSubscriptionsListIterator.NextWithContext") 1892 defer func() { 1893 sc := -1 1894 if iter.Response().Response.Response != nil { 1895 sc = iter.Response().Response.Response.StatusCode 1896 } 1897 tracing.EndSpan(ctx, sc, err) 1898 }() 1899 } 1900 iter.i++ 1901 if iter.i < len(iter.page.Values()) { 1902 return nil 1903 } 1904 err = iter.page.NextWithContext(ctx) 1905 if err != nil { 1906 iter.i-- 1907 return err 1908 } 1909 iter.i = 0 1910 return nil 1911} 1912 1913// Next advances to the next value. If there was an error making 1914// the request the iterator does not advance and the error is returned. 1915// Deprecated: Use NextWithContext() instead. 1916func (iter *PreviewSubscriptionsListIterator) Next() error { 1917 return iter.NextWithContext(context.Background()) 1918} 1919 1920// NotDone returns true if the enumeration should be started or is not yet complete. 1921func (iter PreviewSubscriptionsListIterator) NotDone() bool { 1922 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1923} 1924 1925// Response returns the raw server response from the last page request. 1926func (iter PreviewSubscriptionsListIterator) Response() PreviewSubscriptionsList { 1927 return iter.page.Response() 1928} 1929 1930// Value returns the current value or a zero-initialized value if the 1931// iterator has advanced beyond the end of the collection. 1932func (iter PreviewSubscriptionsListIterator) Value() PreviewSubscription { 1933 if !iter.page.NotDone() { 1934 return PreviewSubscription{} 1935 } 1936 return iter.page.Values()[iter.i] 1937} 1938 1939// Creates a new instance of the PreviewSubscriptionsListIterator type. 1940func NewPreviewSubscriptionsListIterator(page PreviewSubscriptionsListPage) PreviewSubscriptionsListIterator { 1941 return PreviewSubscriptionsListIterator{page: page} 1942} 1943 1944// IsEmpty returns true if the ListResult contains no values. 1945func (psl PreviewSubscriptionsList) IsEmpty() bool { 1946 return psl.Value == nil || len(*psl.Value) == 0 1947} 1948 1949// hasNextLink returns true if the NextLink is not empty. 1950func (psl PreviewSubscriptionsList) hasNextLink() bool { 1951 return psl.NextLink != nil && len(*psl.NextLink) != 0 1952} 1953 1954// previewSubscriptionsListPreparer prepares a request to retrieve the next set of results. 1955// It returns nil if no more results exist. 1956func (psl PreviewSubscriptionsList) previewSubscriptionsListPreparer(ctx context.Context) (*http.Request, error) { 1957 if !psl.hasNextLink() { 1958 return nil, nil 1959 } 1960 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1961 autorest.AsJSON(), 1962 autorest.AsGet(), 1963 autorest.WithBaseURL(to.String(psl.NextLink))) 1964} 1965 1966// PreviewSubscriptionsListPage contains a page of PreviewSubscription values. 1967type PreviewSubscriptionsListPage struct { 1968 fn func(context.Context, PreviewSubscriptionsList) (PreviewSubscriptionsList, error) 1969 psl PreviewSubscriptionsList 1970} 1971 1972// NextWithContext advances to the next page of values. If there was an error making 1973// the request the page does not advance and the error is returned. 1974func (page *PreviewSubscriptionsListPage) NextWithContext(ctx context.Context) (err error) { 1975 if tracing.IsEnabled() { 1976 ctx = tracing.StartSpan(ctx, fqdn+"/PreviewSubscriptionsListPage.NextWithContext") 1977 defer func() { 1978 sc := -1 1979 if page.Response().Response.Response != nil { 1980 sc = page.Response().Response.Response.StatusCode 1981 } 1982 tracing.EndSpan(ctx, sc, err) 1983 }() 1984 } 1985 for { 1986 next, err := page.fn(ctx, page.psl) 1987 if err != nil { 1988 return err 1989 } 1990 page.psl = next 1991 if !next.hasNextLink() || !next.IsEmpty() { 1992 break 1993 } 1994 } 1995 return nil 1996} 1997 1998// Next advances to the next page of values. If there was an error making 1999// the request the page does not advance and the error is returned. 2000// Deprecated: Use NextWithContext() instead. 2001func (page *PreviewSubscriptionsListPage) Next() error { 2002 return page.NextWithContext(context.Background()) 2003} 2004 2005// NotDone returns true if the page enumeration should be started or is not yet complete. 2006func (page PreviewSubscriptionsListPage) NotDone() bool { 2007 return !page.psl.IsEmpty() 2008} 2009 2010// Response returns the raw server response from the last page request. 2011func (page PreviewSubscriptionsListPage) Response() PreviewSubscriptionsList { 2012 return page.psl 2013} 2014 2015// Values returns the slice of values for the current page or nil if there are no values. 2016func (page PreviewSubscriptionsListPage) Values() []PreviewSubscription { 2017 if page.psl.IsEmpty() { 2018 return nil 2019 } 2020 return *page.psl.Value 2021} 2022 2023// Creates a new instance of the PreviewSubscriptionsListPage type. 2024func NewPreviewSubscriptionsListPage(cur PreviewSubscriptionsList, getNextPage func(context.Context, PreviewSubscriptionsList) (PreviewSubscriptionsList, error)) PreviewSubscriptionsListPage { 2025 return PreviewSubscriptionsListPage{ 2026 fn: getNextPage, 2027 psl: cur, 2028 } 2029} 2030 2031// ProxyResource the resource model definition for an Azure Resource Manager proxy resource. It will have 2032// everything other than required location and tags 2033type ProxyResource struct { 2034 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 2035 ID *string `json:"id,omitempty"` 2036 // Name - READ-ONLY; The name of the resource 2037 Name *string `json:"name,omitempty"` 2038 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 2039 Type *string `json:"type,omitempty"` 2040} 2041 2042// Resource common fields that are returned in the response for all Azure Resource Manager resources 2043type Resource struct { 2044 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 2045 ID *string `json:"id,omitempty"` 2046 // Name - READ-ONLY; The name of the resource 2047 Name *string `json:"name,omitempty"` 2048 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 2049 Type *string `json:"type,omitempty"` 2050} 2051 2052// RoleInstance the role instance sub resource. 2053type RoleInstance struct { 2054 autorest.Response `json:"-"` 2055 // Name - The role instance name. 2056 Name *string `json:"name,omitempty"` 2057 // ID - The ARM ID of the resource. 2058 ID *string `json:"id,omitempty"` 2059 // Type - The type of the resource. 2060 Type *string `json:"type,omitempty"` 2061 // RoleInstanceProperties - The role instance properties. 2062 *RoleInstanceProperties `json:"properties,omitempty"` 2063} 2064 2065// MarshalJSON is the custom marshaler for RoleInstance. 2066func (ri RoleInstance) MarshalJSON() ([]byte, error) { 2067 objectMap := make(map[string]interface{}) 2068 if ri.Name != nil { 2069 objectMap["name"] = ri.Name 2070 } 2071 if ri.ID != nil { 2072 objectMap["id"] = ri.ID 2073 } 2074 if ri.Type != nil { 2075 objectMap["type"] = ri.Type 2076 } 2077 if ri.RoleInstanceProperties != nil { 2078 objectMap["properties"] = ri.RoleInstanceProperties 2079 } 2080 return json.Marshal(objectMap) 2081} 2082 2083// UnmarshalJSON is the custom unmarshaler for RoleInstance struct. 2084func (ri *RoleInstance) UnmarshalJSON(body []byte) error { 2085 var m map[string]*json.RawMessage 2086 err := json.Unmarshal(body, &m) 2087 if err != nil { 2088 return err 2089 } 2090 for k, v := range m { 2091 switch k { 2092 case "name": 2093 if v != nil { 2094 var name string 2095 err = json.Unmarshal(*v, &name) 2096 if err != nil { 2097 return err 2098 } 2099 ri.Name = &name 2100 } 2101 case "id": 2102 if v != nil { 2103 var ID string 2104 err = json.Unmarshal(*v, &ID) 2105 if err != nil { 2106 return err 2107 } 2108 ri.ID = &ID 2109 } 2110 case "type": 2111 if v != nil { 2112 var typeVar string 2113 err = json.Unmarshal(*v, &typeVar) 2114 if err != nil { 2115 return err 2116 } 2117 ri.Type = &typeVar 2118 } 2119 case "properties": 2120 if v != nil { 2121 var roleInstanceProperties RoleInstanceProperties 2122 err = json.Unmarshal(*v, &roleInstanceProperties) 2123 if err != nil { 2124 return err 2125 } 2126 ri.RoleInstanceProperties = &roleInstanceProperties 2127 } 2128 } 2129 } 2130 2131 return nil 2132} 2133 2134// RoleInstanceProperties the role instance properties of the network function. 2135type RoleInstanceProperties struct { 2136 // OperationalState - The operational state of the role instance. Possible values include: 'OperationalStateUnknown', 'OperationalStateStopped', 'OperationalStateRunning', 'OperationalStateStopping', 'OperationalStateStarting' 2137 OperationalState OperationalState `json:"operationalState,omitempty"` 2138} 2139 2140// RoleInstancesRestartFuture an abstraction for monitoring and retrieving the results of a long-running 2141// operation. 2142type RoleInstancesRestartFuture struct { 2143 azure.FutureAPI 2144 // Result returns the result of the asynchronous operation. 2145 // If the operation has not completed it will return an error. 2146 Result func(RoleInstancesClient) (autorest.Response, error) 2147} 2148 2149// RoleInstancesStartFuture an abstraction for monitoring and retrieving the results of a long-running 2150// operation. 2151type RoleInstancesStartFuture struct { 2152 azure.FutureAPI 2153 // Result returns the result of the asynchronous operation. 2154 // If the operation has not completed it will return an error. 2155 Result func(RoleInstancesClient) (autorest.Response, error) 2156} 2157 2158// RoleInstancesStopFuture an abstraction for monitoring and retrieving the results of a long-running 2159// operation. 2160type RoleInstancesStopFuture struct { 2161 azure.FutureAPI 2162 // Result returns the result of the asynchronous operation. 2163 // If the operation has not completed it will return an error. 2164 Result func(RoleInstancesClient) (autorest.Response, error) 2165} 2166 2167// SkuOverview the network function sku overview. 2168type SkuOverview struct { 2169 // SkuName - The vendor sku name. 2170 SkuName *string `json:"skuName,omitempty"` 2171 // SkuType - The vendor sku type. Possible values include: 'SkuTypeUnknown', 'SkuTypeEvolvedPacketCore', 'SkuTypeSDWAN', 'SkuTypeFirewall' 2172 SkuType SkuType `json:"skuType,omitempty"` 2173} 2174 2175// SSHConfiguration SSH configuration for Linux based VMs running on Azure 2176type SSHConfiguration struct { 2177 // PublicKeys - The list of SSH public keys used to authenticate with linux based VMs. 2178 PublicKeys *[]SSHPublicKey `json:"publicKeys,omitempty"` 2179} 2180 2181// SSHPublicKey contains information about SSH certificate public key and the path on the Linux VM where 2182// the public key is placed. 2183type SSHPublicKey struct { 2184 // Path - Specifies the full path on the created VM where ssh public key is stored. If the file already exists, the specified key is appended to the file. Example: /home/user/.ssh/authorized_keys 2185 Path *string `json:"path,omitempty"` 2186 // KeyData - SSH public key certificate used to authenticate with the VM through ssh. The key needs to be at least 2048-bit and in ssh-rsa format. <br><br> For creating ssh keys, see [Create SSH keys on Linux and Mac for Linux VMs in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). 2187 KeyData *string `json:"keyData,omitempty"` 2188} 2189 2190// StorageProfile specifies the storage settings for the virtual machine disks. 2191type StorageProfile struct { 2192 // ImageReference - The image reference properties. 2193 ImageReference *ImageReference `json:"imageReference,omitempty"` 2194 // OsDisk - Specifies information about the operating system disk used by the virtual machine. 2195 OsDisk *OsDisk `json:"osDisk,omitempty"` 2196 // DataDisks - Specifies the parameters that are used to add a data disk to a virtual machine. 2197 DataDisks *[]DataDisk `json:"dataDisks,omitempty"` 2198} 2199 2200// SubResource reference to another sub resource. 2201type SubResource struct { 2202 // ID - Resource ID. 2203 ID *string `json:"id,omitempty"` 2204} 2205 2206// TagsObject tags object for patch operations. 2207type TagsObject struct { 2208 // Tags - Resource tags. 2209 Tags map[string]*string `json:"tags"` 2210} 2211 2212// MarshalJSON is the custom marshaler for TagsObject. 2213func (toVar TagsObject) MarshalJSON() ([]byte, error) { 2214 objectMap := make(map[string]interface{}) 2215 if toVar.Tags != nil { 2216 objectMap["tags"] = toVar.Tags 2217 } 2218 return json.Marshal(objectMap) 2219} 2220 2221// TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource 2222type TrackedResource struct { 2223 // Tags - Resource tags. 2224 Tags map[string]*string `json:"tags"` 2225 // Location - The geo-location where the resource lives 2226 Location *string `json:"location,omitempty"` 2227 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 2228 ID *string `json:"id,omitempty"` 2229 // Name - READ-ONLY; The name of the resource 2230 Name *string `json:"name,omitempty"` 2231 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 2232 Type *string `json:"type,omitempty"` 2233} 2234 2235// MarshalJSON is the custom marshaler for TrackedResource. 2236func (tr TrackedResource) MarshalJSON() ([]byte, error) { 2237 objectMap := make(map[string]interface{}) 2238 if tr.Tags != nil { 2239 objectMap["tags"] = tr.Tags 2240 } 2241 if tr.Location != nil { 2242 objectMap["location"] = tr.Location 2243 } 2244 return json.Marshal(objectMap) 2245} 2246 2247// Vendor vendor resource. 2248type Vendor struct { 2249 autorest.Response `json:"-"` 2250 // VendorPropertiesFormat - Vendor properties. 2251 *VendorPropertiesFormat `json:"properties,omitempty"` 2252 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 2253 ID *string `json:"id,omitempty"` 2254 // Name - READ-ONLY; The name of the resource 2255 Name *string `json:"name,omitempty"` 2256 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 2257 Type *string `json:"type,omitempty"` 2258} 2259 2260// MarshalJSON is the custom marshaler for Vendor. 2261func (vVar Vendor) MarshalJSON() ([]byte, error) { 2262 objectMap := make(map[string]interface{}) 2263 if vVar.VendorPropertiesFormat != nil { 2264 objectMap["properties"] = vVar.VendorPropertiesFormat 2265 } 2266 return json.Marshal(objectMap) 2267} 2268 2269// UnmarshalJSON is the custom unmarshaler for Vendor struct. 2270func (vVar *Vendor) UnmarshalJSON(body []byte) error { 2271 var m map[string]*json.RawMessage 2272 err := json.Unmarshal(body, &m) 2273 if err != nil { 2274 return err 2275 } 2276 for k, v := range m { 2277 switch k { 2278 case "properties": 2279 if v != nil { 2280 var vendorPropertiesFormat VendorPropertiesFormat 2281 err = json.Unmarshal(*v, &vendorPropertiesFormat) 2282 if err != nil { 2283 return err 2284 } 2285 vVar.VendorPropertiesFormat = &vendorPropertiesFormat 2286 } 2287 case "id": 2288 if v != nil { 2289 var ID string 2290 err = json.Unmarshal(*v, &ID) 2291 if err != nil { 2292 return err 2293 } 2294 vVar.ID = &ID 2295 } 2296 case "name": 2297 if v != nil { 2298 var name string 2299 err = json.Unmarshal(*v, &name) 2300 if err != nil { 2301 return err 2302 } 2303 vVar.Name = &name 2304 } 2305 case "type": 2306 if v != nil { 2307 var typeVar string 2308 err = json.Unmarshal(*v, &typeVar) 2309 if err != nil { 2310 return err 2311 } 2312 vVar.Type = &typeVar 2313 } 2314 } 2315 } 2316 2317 return nil 2318} 2319 2320// VendorDetails the network function vendor details. 2321type VendorDetails struct { 2322 // VendorName - The network function vendor name. 2323 VendorName *string `json:"vendorName,omitempty"` 2324 // SkuList - The network function sku list. 2325 SkuList *[]SkuOverview `json:"skuList,omitempty"` 2326} 2327 2328// VendorListResult response for vendors API service call. 2329type VendorListResult struct { 2330 autorest.Response `json:"-"` 2331 // Value - A list of vendors. 2332 Value *[]Vendor `json:"value,omitempty"` 2333 // NextLink - READ-ONLY; The URL to get the next set of results. 2334 NextLink *string `json:"nextLink,omitempty"` 2335} 2336 2337// MarshalJSON is the custom marshaler for VendorListResult. 2338func (vlr VendorListResult) MarshalJSON() ([]byte, error) { 2339 objectMap := make(map[string]interface{}) 2340 if vlr.Value != nil { 2341 objectMap["value"] = vlr.Value 2342 } 2343 return json.Marshal(objectMap) 2344} 2345 2346// VendorListResultIterator provides access to a complete listing of Vendor values. 2347type VendorListResultIterator struct { 2348 i int 2349 page VendorListResultPage 2350} 2351 2352// NextWithContext advances to the next value. If there was an error making 2353// the request the iterator does not advance and the error is returned. 2354func (iter *VendorListResultIterator) NextWithContext(ctx context.Context) (err error) { 2355 if tracing.IsEnabled() { 2356 ctx = tracing.StartSpan(ctx, fqdn+"/VendorListResultIterator.NextWithContext") 2357 defer func() { 2358 sc := -1 2359 if iter.Response().Response.Response != nil { 2360 sc = iter.Response().Response.Response.StatusCode 2361 } 2362 tracing.EndSpan(ctx, sc, err) 2363 }() 2364 } 2365 iter.i++ 2366 if iter.i < len(iter.page.Values()) { 2367 return nil 2368 } 2369 err = iter.page.NextWithContext(ctx) 2370 if err != nil { 2371 iter.i-- 2372 return err 2373 } 2374 iter.i = 0 2375 return nil 2376} 2377 2378// Next advances to the next value. If there was an error making 2379// the request the iterator does not advance and the error is returned. 2380// Deprecated: Use NextWithContext() instead. 2381func (iter *VendorListResultIterator) Next() error { 2382 return iter.NextWithContext(context.Background()) 2383} 2384 2385// NotDone returns true if the enumeration should be started or is not yet complete. 2386func (iter VendorListResultIterator) NotDone() bool { 2387 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2388} 2389 2390// Response returns the raw server response from the last page request. 2391func (iter VendorListResultIterator) Response() VendorListResult { 2392 return iter.page.Response() 2393} 2394 2395// Value returns the current value or a zero-initialized value if the 2396// iterator has advanced beyond the end of the collection. 2397func (iter VendorListResultIterator) Value() Vendor { 2398 if !iter.page.NotDone() { 2399 return Vendor{} 2400 } 2401 return iter.page.Values()[iter.i] 2402} 2403 2404// Creates a new instance of the VendorListResultIterator type. 2405func NewVendorListResultIterator(page VendorListResultPage) VendorListResultIterator { 2406 return VendorListResultIterator{page: page} 2407} 2408 2409// IsEmpty returns true if the ListResult contains no values. 2410func (vlr VendorListResult) IsEmpty() bool { 2411 return vlr.Value == nil || len(*vlr.Value) == 0 2412} 2413 2414// hasNextLink returns true if the NextLink is not empty. 2415func (vlr VendorListResult) hasNextLink() bool { 2416 return vlr.NextLink != nil && len(*vlr.NextLink) != 0 2417} 2418 2419// vendorListResultPreparer prepares a request to retrieve the next set of results. 2420// It returns nil if no more results exist. 2421func (vlr VendorListResult) vendorListResultPreparer(ctx context.Context) (*http.Request, error) { 2422 if !vlr.hasNextLink() { 2423 return nil, nil 2424 } 2425 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2426 autorest.AsJSON(), 2427 autorest.AsGet(), 2428 autorest.WithBaseURL(to.String(vlr.NextLink))) 2429} 2430 2431// VendorListResultPage contains a page of Vendor values. 2432type VendorListResultPage struct { 2433 fn func(context.Context, VendorListResult) (VendorListResult, error) 2434 vlr VendorListResult 2435} 2436 2437// NextWithContext advances to the next page of values. If there was an error making 2438// the request the page does not advance and the error is returned. 2439func (page *VendorListResultPage) NextWithContext(ctx context.Context) (err error) { 2440 if tracing.IsEnabled() { 2441 ctx = tracing.StartSpan(ctx, fqdn+"/VendorListResultPage.NextWithContext") 2442 defer func() { 2443 sc := -1 2444 if page.Response().Response.Response != nil { 2445 sc = page.Response().Response.Response.StatusCode 2446 } 2447 tracing.EndSpan(ctx, sc, err) 2448 }() 2449 } 2450 for { 2451 next, err := page.fn(ctx, page.vlr) 2452 if err != nil { 2453 return err 2454 } 2455 page.vlr = next 2456 if !next.hasNextLink() || !next.IsEmpty() { 2457 break 2458 } 2459 } 2460 return nil 2461} 2462 2463// Next advances to the next page of values. If there was an error making 2464// the request the page does not advance and the error is returned. 2465// Deprecated: Use NextWithContext() instead. 2466func (page *VendorListResultPage) Next() error { 2467 return page.NextWithContext(context.Background()) 2468} 2469 2470// NotDone returns true if the page enumeration should be started or is not yet complete. 2471func (page VendorListResultPage) NotDone() bool { 2472 return !page.vlr.IsEmpty() 2473} 2474 2475// Response returns the raw server response from the last page request. 2476func (page VendorListResultPage) Response() VendorListResult { 2477 return page.vlr 2478} 2479 2480// Values returns the slice of values for the current page or nil if there are no values. 2481func (page VendorListResultPage) Values() []Vendor { 2482 if page.vlr.IsEmpty() { 2483 return nil 2484 } 2485 return *page.vlr.Value 2486} 2487 2488// Creates a new instance of the VendorListResultPage type. 2489func NewVendorListResultPage(cur VendorListResult, getNextPage func(context.Context, VendorListResult) (VendorListResult, error)) VendorListResultPage { 2490 return VendorListResultPage{ 2491 fn: getNextPage, 2492 vlr: cur, 2493 } 2494} 2495 2496// VendorNetworkFunction vendor network function sub resource. 2497type VendorNetworkFunction struct { 2498 autorest.Response `json:"-"` 2499 // VendorNetworkFunctionPropertiesFormat - Network function details. 2500 *VendorNetworkFunctionPropertiesFormat `json:"properties,omitempty"` 2501 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 2502 ID *string `json:"id,omitempty"` 2503 // Name - READ-ONLY; The name of the resource 2504 Name *string `json:"name,omitempty"` 2505 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 2506 Type *string `json:"type,omitempty"` 2507} 2508 2509// MarshalJSON is the custom marshaler for VendorNetworkFunction. 2510func (vnf VendorNetworkFunction) MarshalJSON() ([]byte, error) { 2511 objectMap := make(map[string]interface{}) 2512 if vnf.VendorNetworkFunctionPropertiesFormat != nil { 2513 objectMap["properties"] = vnf.VendorNetworkFunctionPropertiesFormat 2514 } 2515 return json.Marshal(objectMap) 2516} 2517 2518// UnmarshalJSON is the custom unmarshaler for VendorNetworkFunction struct. 2519func (vnf *VendorNetworkFunction) UnmarshalJSON(body []byte) error { 2520 var m map[string]*json.RawMessage 2521 err := json.Unmarshal(body, &m) 2522 if err != nil { 2523 return err 2524 } 2525 for k, v := range m { 2526 switch k { 2527 case "properties": 2528 if v != nil { 2529 var vendorNetworkFunctionPropertiesFormat VendorNetworkFunctionPropertiesFormat 2530 err = json.Unmarshal(*v, &vendorNetworkFunctionPropertiesFormat) 2531 if err != nil { 2532 return err 2533 } 2534 vnf.VendorNetworkFunctionPropertiesFormat = &vendorNetworkFunctionPropertiesFormat 2535 } 2536 case "id": 2537 if v != nil { 2538 var ID string 2539 err = json.Unmarshal(*v, &ID) 2540 if err != nil { 2541 return err 2542 } 2543 vnf.ID = &ID 2544 } 2545 case "name": 2546 if v != nil { 2547 var name string 2548 err = json.Unmarshal(*v, &name) 2549 if err != nil { 2550 return err 2551 } 2552 vnf.Name = &name 2553 } 2554 case "type": 2555 if v != nil { 2556 var typeVar string 2557 err = json.Unmarshal(*v, &typeVar) 2558 if err != nil { 2559 return err 2560 } 2561 vnf.Type = &typeVar 2562 } 2563 } 2564 } 2565 2566 return nil 2567} 2568 2569// VendorNetworkFunctionListResult response for vendors API service call. 2570type VendorNetworkFunctionListResult struct { 2571 autorest.Response `json:"-"` 2572 // Value - A list of vendor network functions. 2573 Value *[]VendorNetworkFunction `json:"value,omitempty"` 2574 // NextLink - READ-ONLY; The URL to get the next set of results. 2575 NextLink *string `json:"nextLink,omitempty"` 2576} 2577 2578// MarshalJSON is the custom marshaler for VendorNetworkFunctionListResult. 2579func (vnflr VendorNetworkFunctionListResult) MarshalJSON() ([]byte, error) { 2580 objectMap := make(map[string]interface{}) 2581 if vnflr.Value != nil { 2582 objectMap["value"] = vnflr.Value 2583 } 2584 return json.Marshal(objectMap) 2585} 2586 2587// VendorNetworkFunctionListResultIterator provides access to a complete listing of VendorNetworkFunction 2588// values. 2589type VendorNetworkFunctionListResultIterator struct { 2590 i int 2591 page VendorNetworkFunctionListResultPage 2592} 2593 2594// NextWithContext advances to the next value. If there was an error making 2595// the request the iterator does not advance and the error is returned. 2596func (iter *VendorNetworkFunctionListResultIterator) NextWithContext(ctx context.Context) (err error) { 2597 if tracing.IsEnabled() { 2598 ctx = tracing.StartSpan(ctx, fqdn+"/VendorNetworkFunctionListResultIterator.NextWithContext") 2599 defer func() { 2600 sc := -1 2601 if iter.Response().Response.Response != nil { 2602 sc = iter.Response().Response.Response.StatusCode 2603 } 2604 tracing.EndSpan(ctx, sc, err) 2605 }() 2606 } 2607 iter.i++ 2608 if iter.i < len(iter.page.Values()) { 2609 return nil 2610 } 2611 err = iter.page.NextWithContext(ctx) 2612 if err != nil { 2613 iter.i-- 2614 return err 2615 } 2616 iter.i = 0 2617 return nil 2618} 2619 2620// Next advances to the next value. If there was an error making 2621// the request the iterator does not advance and the error is returned. 2622// Deprecated: Use NextWithContext() instead. 2623func (iter *VendorNetworkFunctionListResultIterator) Next() error { 2624 return iter.NextWithContext(context.Background()) 2625} 2626 2627// NotDone returns true if the enumeration should be started or is not yet complete. 2628func (iter VendorNetworkFunctionListResultIterator) NotDone() bool { 2629 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2630} 2631 2632// Response returns the raw server response from the last page request. 2633func (iter VendorNetworkFunctionListResultIterator) Response() VendorNetworkFunctionListResult { 2634 return iter.page.Response() 2635} 2636 2637// Value returns the current value or a zero-initialized value if the 2638// iterator has advanced beyond the end of the collection. 2639func (iter VendorNetworkFunctionListResultIterator) Value() VendorNetworkFunction { 2640 if !iter.page.NotDone() { 2641 return VendorNetworkFunction{} 2642 } 2643 return iter.page.Values()[iter.i] 2644} 2645 2646// Creates a new instance of the VendorNetworkFunctionListResultIterator type. 2647func NewVendorNetworkFunctionListResultIterator(page VendorNetworkFunctionListResultPage) VendorNetworkFunctionListResultIterator { 2648 return VendorNetworkFunctionListResultIterator{page: page} 2649} 2650 2651// IsEmpty returns true if the ListResult contains no values. 2652func (vnflr VendorNetworkFunctionListResult) IsEmpty() bool { 2653 return vnflr.Value == nil || len(*vnflr.Value) == 0 2654} 2655 2656// hasNextLink returns true if the NextLink is not empty. 2657func (vnflr VendorNetworkFunctionListResult) hasNextLink() bool { 2658 return vnflr.NextLink != nil && len(*vnflr.NextLink) != 0 2659} 2660 2661// vendorNetworkFunctionListResultPreparer prepares a request to retrieve the next set of results. 2662// It returns nil if no more results exist. 2663func (vnflr VendorNetworkFunctionListResult) vendorNetworkFunctionListResultPreparer(ctx context.Context) (*http.Request, error) { 2664 if !vnflr.hasNextLink() { 2665 return nil, nil 2666 } 2667 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2668 autorest.AsJSON(), 2669 autorest.AsGet(), 2670 autorest.WithBaseURL(to.String(vnflr.NextLink))) 2671} 2672 2673// VendorNetworkFunctionListResultPage contains a page of VendorNetworkFunction values. 2674type VendorNetworkFunctionListResultPage struct { 2675 fn func(context.Context, VendorNetworkFunctionListResult) (VendorNetworkFunctionListResult, error) 2676 vnflr VendorNetworkFunctionListResult 2677} 2678 2679// NextWithContext advances to the next page of values. If there was an error making 2680// the request the page does not advance and the error is returned. 2681func (page *VendorNetworkFunctionListResultPage) NextWithContext(ctx context.Context) (err error) { 2682 if tracing.IsEnabled() { 2683 ctx = tracing.StartSpan(ctx, fqdn+"/VendorNetworkFunctionListResultPage.NextWithContext") 2684 defer func() { 2685 sc := -1 2686 if page.Response().Response.Response != nil { 2687 sc = page.Response().Response.Response.StatusCode 2688 } 2689 tracing.EndSpan(ctx, sc, err) 2690 }() 2691 } 2692 for { 2693 next, err := page.fn(ctx, page.vnflr) 2694 if err != nil { 2695 return err 2696 } 2697 page.vnflr = next 2698 if !next.hasNextLink() || !next.IsEmpty() { 2699 break 2700 } 2701 } 2702 return nil 2703} 2704 2705// Next advances to the next page of values. If there was an error making 2706// the request the page does not advance and the error is returned. 2707// Deprecated: Use NextWithContext() instead. 2708func (page *VendorNetworkFunctionListResultPage) Next() error { 2709 return page.NextWithContext(context.Background()) 2710} 2711 2712// NotDone returns true if the page enumeration should be started or is not yet complete. 2713func (page VendorNetworkFunctionListResultPage) NotDone() bool { 2714 return !page.vnflr.IsEmpty() 2715} 2716 2717// Response returns the raw server response from the last page request. 2718func (page VendorNetworkFunctionListResultPage) Response() VendorNetworkFunctionListResult { 2719 return page.vnflr 2720} 2721 2722// Values returns the slice of values for the current page or nil if there are no values. 2723func (page VendorNetworkFunctionListResultPage) Values() []VendorNetworkFunction { 2724 if page.vnflr.IsEmpty() { 2725 return nil 2726 } 2727 return *page.vnflr.Value 2728} 2729 2730// Creates a new instance of the VendorNetworkFunctionListResultPage type. 2731func NewVendorNetworkFunctionListResultPage(cur VendorNetworkFunctionListResult, getNextPage func(context.Context, VendorNetworkFunctionListResult) (VendorNetworkFunctionListResult, error)) VendorNetworkFunctionListResultPage { 2732 return VendorNetworkFunctionListResultPage{ 2733 fn: getNextPage, 2734 vnflr: cur, 2735 } 2736} 2737 2738// VendorNetworkFunctionPropertiesFormat vendor network function properties. 2739type VendorNetworkFunctionPropertiesFormat struct { 2740 // ProvisioningState - READ-ONLY; The provisioning state of the vendor network function sub resource. Possible values include: 'ProvisioningStateUnknown', 'ProvisioningStateSucceeded', 'ProvisioningStateAccepted', 'ProvisioningStateDeleting', 'ProvisioningStateFailed', 'ProvisioningStateCanceled', 'ProvisioningStateDeleted' 2741 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 2742 // VendorProvisioningState - The vendor controlled provisioning state of the vendor network function. Possible values include: 'VendorProvisioningStateUnknown', 'VendorProvisioningStateNotProvisioned', 'VendorProvisioningStateProvisioning', 'VendorProvisioningStateProvisioned', 'VendorProvisioningStateDeprovisioned', 'VendorProvisioningStateUserDataValidationFailed' 2743 VendorProvisioningState VendorProvisioningState `json:"vendorProvisioningState,omitempty"` 2744 // SkuName - READ-ONLY; The name of the sku. 2745 SkuName *string `json:"skuName,omitempty"` 2746 // SkuType - READ-ONLY; The sku type. Possible values include: 'SkuTypeUnknown', 'SkuTypeEvolvedPacketCore', 'SkuTypeSDWAN', 'SkuTypeFirewall' 2747 SkuType SkuType `json:"skuType,omitempty"` 2748 // NetworkFunctionVendorConfigurations - An array of network function vendor configurations. 2749 NetworkFunctionVendorConfigurations *[]NetworkFunctionVendorConfiguration `json:"networkFunctionVendorConfigurations,omitempty"` 2750} 2751 2752// MarshalJSON is the custom marshaler for VendorNetworkFunctionPropertiesFormat. 2753func (vnfpf VendorNetworkFunctionPropertiesFormat) MarshalJSON() ([]byte, error) { 2754 objectMap := make(map[string]interface{}) 2755 if vnfpf.VendorProvisioningState != "" { 2756 objectMap["vendorProvisioningState"] = vnfpf.VendorProvisioningState 2757 } 2758 if vnfpf.NetworkFunctionVendorConfigurations != nil { 2759 objectMap["networkFunctionVendorConfigurations"] = vnfpf.NetworkFunctionVendorConfigurations 2760 } 2761 return json.Marshal(objectMap) 2762} 2763 2764// VendorNetworkFunctionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 2765// long-running operation. 2766type VendorNetworkFunctionsCreateOrUpdateFuture struct { 2767 azure.FutureAPI 2768 // Result returns the result of the asynchronous operation. 2769 // If the operation has not completed it will return an error. 2770 Result func(VendorNetworkFunctionsClient) (VendorNetworkFunction, error) 2771} 2772 2773// VendorPropertiesFormat vendor properties. 2774type VendorPropertiesFormat struct { 2775 // ProvisioningState - READ-ONLY; The provisioning state of the vendor resource. Possible values include: 'ProvisioningStateUnknown', 'ProvisioningStateSucceeded', 'ProvisioningStateAccepted', 'ProvisioningStateDeleting', 'ProvisioningStateFailed', 'ProvisioningStateCanceled', 'ProvisioningStateDeleted' 2776 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 2777 // Skus - READ-ONLY; A list of IDs of the vendor skus offered by the vendor. 2778 Skus *[]SubResource `json:"skus,omitempty"` 2779} 2780 2781// VendorsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 2782// operation. 2783type VendorsCreateOrUpdateFuture struct { 2784 azure.FutureAPI 2785 // Result returns the result of the asynchronous operation. 2786 // If the operation has not completed it will return an error. 2787 Result func(VendorsClient) (Vendor, error) 2788} 2789 2790// VendorsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 2791// operation. 2792type VendorsDeleteFuture struct { 2793 azure.FutureAPI 2794 // Result returns the result of the asynchronous operation. 2795 // If the operation has not completed it will return an error. 2796 Result func(VendorsClient) (autorest.Response, error) 2797} 2798 2799// VendorSku sku sub resource. 2800type VendorSku struct { 2801 autorest.Response `json:"-"` 2802 // VendorSkuPropertiesFormat - Vendor sku details. 2803 *VendorSkuPropertiesFormat `json:"properties,omitempty"` 2804 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 2805 ID *string `json:"id,omitempty"` 2806 // Name - READ-ONLY; The name of the resource 2807 Name *string `json:"name,omitempty"` 2808 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 2809 Type *string `json:"type,omitempty"` 2810} 2811 2812// MarshalJSON is the custom marshaler for VendorSku. 2813func (vs VendorSku) MarshalJSON() ([]byte, error) { 2814 objectMap := make(map[string]interface{}) 2815 if vs.VendorSkuPropertiesFormat != nil { 2816 objectMap["properties"] = vs.VendorSkuPropertiesFormat 2817 } 2818 return json.Marshal(objectMap) 2819} 2820 2821// UnmarshalJSON is the custom unmarshaler for VendorSku struct. 2822func (vs *VendorSku) UnmarshalJSON(body []byte) error { 2823 var m map[string]*json.RawMessage 2824 err := json.Unmarshal(body, &m) 2825 if err != nil { 2826 return err 2827 } 2828 for k, v := range m { 2829 switch k { 2830 case "properties": 2831 if v != nil { 2832 var vendorSkuPropertiesFormat VendorSkuPropertiesFormat 2833 err = json.Unmarshal(*v, &vendorSkuPropertiesFormat) 2834 if err != nil { 2835 return err 2836 } 2837 vs.VendorSkuPropertiesFormat = &vendorSkuPropertiesFormat 2838 } 2839 case "id": 2840 if v != nil { 2841 var ID string 2842 err = json.Unmarshal(*v, &ID) 2843 if err != nil { 2844 return err 2845 } 2846 vs.ID = &ID 2847 } 2848 case "name": 2849 if v != nil { 2850 var name string 2851 err = json.Unmarshal(*v, &name) 2852 if err != nil { 2853 return err 2854 } 2855 vs.Name = &name 2856 } 2857 case "type": 2858 if v != nil { 2859 var typeVar string 2860 err = json.Unmarshal(*v, &typeVar) 2861 if err != nil { 2862 return err 2863 } 2864 vs.Type = &typeVar 2865 } 2866 } 2867 } 2868 2869 return nil 2870} 2871 2872// VendorSkuListResult response for list vendor sku API service call. 2873type VendorSkuListResult struct { 2874 autorest.Response `json:"-"` 2875 // Value - A list of vendor skus offered by the vendor. 2876 Value *[]VendorSku `json:"value,omitempty"` 2877 // NextLink - READ-ONLY; The URI to get the next set of results. 2878 NextLink *string `json:"nextLink,omitempty"` 2879} 2880 2881// MarshalJSON is the custom marshaler for VendorSkuListResult. 2882func (vslr VendorSkuListResult) MarshalJSON() ([]byte, error) { 2883 objectMap := make(map[string]interface{}) 2884 if vslr.Value != nil { 2885 objectMap["value"] = vslr.Value 2886 } 2887 return json.Marshal(objectMap) 2888} 2889 2890// VendorSkuListResultIterator provides access to a complete listing of VendorSku values. 2891type VendorSkuListResultIterator struct { 2892 i int 2893 page VendorSkuListResultPage 2894} 2895 2896// NextWithContext advances to the next value. If there was an error making 2897// the request the iterator does not advance and the error is returned. 2898func (iter *VendorSkuListResultIterator) NextWithContext(ctx context.Context) (err error) { 2899 if tracing.IsEnabled() { 2900 ctx = tracing.StartSpan(ctx, fqdn+"/VendorSkuListResultIterator.NextWithContext") 2901 defer func() { 2902 sc := -1 2903 if iter.Response().Response.Response != nil { 2904 sc = iter.Response().Response.Response.StatusCode 2905 } 2906 tracing.EndSpan(ctx, sc, err) 2907 }() 2908 } 2909 iter.i++ 2910 if iter.i < len(iter.page.Values()) { 2911 return nil 2912 } 2913 err = iter.page.NextWithContext(ctx) 2914 if err != nil { 2915 iter.i-- 2916 return err 2917 } 2918 iter.i = 0 2919 return nil 2920} 2921 2922// Next advances to the next value. If there was an error making 2923// the request the iterator does not advance and the error is returned. 2924// Deprecated: Use NextWithContext() instead. 2925func (iter *VendorSkuListResultIterator) Next() error { 2926 return iter.NextWithContext(context.Background()) 2927} 2928 2929// NotDone returns true if the enumeration should be started or is not yet complete. 2930func (iter VendorSkuListResultIterator) NotDone() bool { 2931 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2932} 2933 2934// Response returns the raw server response from the last page request. 2935func (iter VendorSkuListResultIterator) Response() VendorSkuListResult { 2936 return iter.page.Response() 2937} 2938 2939// Value returns the current value or a zero-initialized value if the 2940// iterator has advanced beyond the end of the collection. 2941func (iter VendorSkuListResultIterator) Value() VendorSku { 2942 if !iter.page.NotDone() { 2943 return VendorSku{} 2944 } 2945 return iter.page.Values()[iter.i] 2946} 2947 2948// Creates a new instance of the VendorSkuListResultIterator type. 2949func NewVendorSkuListResultIterator(page VendorSkuListResultPage) VendorSkuListResultIterator { 2950 return VendorSkuListResultIterator{page: page} 2951} 2952 2953// IsEmpty returns true if the ListResult contains no values. 2954func (vslr VendorSkuListResult) IsEmpty() bool { 2955 return vslr.Value == nil || len(*vslr.Value) == 0 2956} 2957 2958// hasNextLink returns true if the NextLink is not empty. 2959func (vslr VendorSkuListResult) hasNextLink() bool { 2960 return vslr.NextLink != nil && len(*vslr.NextLink) != 0 2961} 2962 2963// vendorSkuListResultPreparer prepares a request to retrieve the next set of results. 2964// It returns nil if no more results exist. 2965func (vslr VendorSkuListResult) vendorSkuListResultPreparer(ctx context.Context) (*http.Request, error) { 2966 if !vslr.hasNextLink() { 2967 return nil, nil 2968 } 2969 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2970 autorest.AsJSON(), 2971 autorest.AsGet(), 2972 autorest.WithBaseURL(to.String(vslr.NextLink))) 2973} 2974 2975// VendorSkuListResultPage contains a page of VendorSku values. 2976type VendorSkuListResultPage struct { 2977 fn func(context.Context, VendorSkuListResult) (VendorSkuListResult, error) 2978 vslr VendorSkuListResult 2979} 2980 2981// NextWithContext advances to the next page of values. If there was an error making 2982// the request the page does not advance and the error is returned. 2983func (page *VendorSkuListResultPage) NextWithContext(ctx context.Context) (err error) { 2984 if tracing.IsEnabled() { 2985 ctx = tracing.StartSpan(ctx, fqdn+"/VendorSkuListResultPage.NextWithContext") 2986 defer func() { 2987 sc := -1 2988 if page.Response().Response.Response != nil { 2989 sc = page.Response().Response.Response.StatusCode 2990 } 2991 tracing.EndSpan(ctx, sc, err) 2992 }() 2993 } 2994 for { 2995 next, err := page.fn(ctx, page.vslr) 2996 if err != nil { 2997 return err 2998 } 2999 page.vslr = next 3000 if !next.hasNextLink() || !next.IsEmpty() { 3001 break 3002 } 3003 } 3004 return nil 3005} 3006 3007// Next advances to the next page of values. If there was an error making 3008// the request the page does not advance and the error is returned. 3009// Deprecated: Use NextWithContext() instead. 3010func (page *VendorSkuListResultPage) Next() error { 3011 return page.NextWithContext(context.Background()) 3012} 3013 3014// NotDone returns true if the page enumeration should be started or is not yet complete. 3015func (page VendorSkuListResultPage) NotDone() bool { 3016 return !page.vslr.IsEmpty() 3017} 3018 3019// Response returns the raw server response from the last page request. 3020func (page VendorSkuListResultPage) Response() VendorSkuListResult { 3021 return page.vslr 3022} 3023 3024// Values returns the slice of values for the current page or nil if there are no values. 3025func (page VendorSkuListResultPage) Values() []VendorSku { 3026 if page.vslr.IsEmpty() { 3027 return nil 3028 } 3029 return *page.vslr.Value 3030} 3031 3032// Creates a new instance of the VendorSkuListResultPage type. 3033func NewVendorSkuListResultPage(cur VendorSkuListResult, getNextPage func(context.Context, VendorSkuListResult) (VendorSkuListResult, error)) VendorSkuListResultPage { 3034 return VendorSkuListResultPage{ 3035 fn: getNextPage, 3036 vslr: cur, 3037 } 3038} 3039 3040// VendorSkuPreviewCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 3041// long-running operation. 3042type VendorSkuPreviewCreateOrUpdateFuture struct { 3043 azure.FutureAPI 3044 // Result returns the result of the asynchronous operation. 3045 // If the operation has not completed it will return an error. 3046 Result func(VendorSkuPreviewClient) (PreviewSubscription, error) 3047} 3048 3049// VendorSkuPreviewDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 3050// operation. 3051type VendorSkuPreviewDeleteFuture struct { 3052 azure.FutureAPI 3053 // Result returns the result of the asynchronous operation. 3054 // If the operation has not completed it will return an error. 3055 Result func(VendorSkuPreviewClient) (autorest.Response, error) 3056} 3057 3058// VendorSkuPropertiesFormat sku properties 3059type VendorSkuPropertiesFormat struct { 3060 // ProvisioningState - READ-ONLY; The provisioning state of the vendor sku sub resource. Possible values include: 'ProvisioningStateUnknown', 'ProvisioningStateSucceeded', 'ProvisioningStateAccepted', 'ProvisioningStateDeleting', 'ProvisioningStateFailed', 'ProvisioningStateCanceled', 'ProvisioningStateDeleted' 3061 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 3062 // SkuType - The sku type. Possible values include: 'SkuTypeUnknown', 'SkuTypeEvolvedPacketCore', 'SkuTypeSDWAN', 'SkuTypeFirewall' 3063 SkuType SkuType `json:"skuType,omitempty"` 3064 // DeploymentMode - The sku deployment mode. Possible values include: 'SkuDeploymentModeUnknown', 'SkuDeploymentModeAzure', 'SkuDeploymentModePrivateEdgeZone' 3065 DeploymentMode SkuDeploymentMode `json:"deploymentMode,omitempty"` 3066 // Preview - Indicates if the vendor sku is in preview mode. 3067 Preview *bool `json:"preview,omitempty"` 3068 // ManagedApplicationParameters - The parameters for the managed application to be supplied by the vendor. 3069 ManagedApplicationParameters interface{} `json:"managedApplicationParameters,omitempty"` 3070 // ManagedApplicationTemplate - The template for the managed application deployment. 3071 ManagedApplicationTemplate interface{} `json:"managedApplicationTemplate,omitempty"` 3072 // NetworkFunctionTemplate - The template definition of the network function. 3073 NetworkFunctionTemplate *NetworkFunctionTemplate `json:"networkFunctionTemplate,omitempty"` 3074} 3075 3076// MarshalJSON is the custom marshaler for VendorSkuPropertiesFormat. 3077func (vspf VendorSkuPropertiesFormat) MarshalJSON() ([]byte, error) { 3078 objectMap := make(map[string]interface{}) 3079 if vspf.SkuType != "" { 3080 objectMap["skuType"] = vspf.SkuType 3081 } 3082 if vspf.DeploymentMode != "" { 3083 objectMap["deploymentMode"] = vspf.DeploymentMode 3084 } 3085 if vspf.Preview != nil { 3086 objectMap["preview"] = vspf.Preview 3087 } 3088 if vspf.ManagedApplicationParameters != nil { 3089 objectMap["managedApplicationParameters"] = vspf.ManagedApplicationParameters 3090 } 3091 if vspf.ManagedApplicationTemplate != nil { 3092 objectMap["managedApplicationTemplate"] = vspf.ManagedApplicationTemplate 3093 } 3094 if vspf.NetworkFunctionTemplate != nil { 3095 objectMap["networkFunctionTemplate"] = vspf.NetworkFunctionTemplate 3096 } 3097 return json.Marshal(objectMap) 3098} 3099 3100// VendorSkusCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 3101// long-running operation. 3102type VendorSkusCreateOrUpdateFuture struct { 3103 azure.FutureAPI 3104 // Result returns the result of the asynchronous operation. 3105 // If the operation has not completed it will return an error. 3106 Result func(VendorSkusClient) (VendorSku, error) 3107} 3108 3109// VendorSkusDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 3110// operation. 3111type VendorSkusDeleteFuture struct { 3112 azure.FutureAPI 3113 // Result returns the result of the asynchronous operation. 3114 // If the operation has not completed it will return an error. 3115 Result func(VendorSkusClient) (autorest.Response, error) 3116} 3117 3118// VirtualHardDisk describes the uri of a disk. 3119type VirtualHardDisk struct { 3120 // URI - Specifies the virtual hard disk's uri. 3121 URI *string `json:"uri,omitempty"` 3122} 3123