1package storsimple 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/date" 26 "github.com/Azure/go-autorest/autorest/to" 27 "github.com/Azure/go-autorest/tracing" 28 "net/http" 29) 30 31// The package's fully qualified name. 32const fqdn = "github.com/Azure/azure-sdk-for-go/services/storsimple1200series/mgmt/2016-10-01/storsimple" 33 34// AlertEmailNotificationStatus enumerates the values for alert email notification status. 35type AlertEmailNotificationStatus string 36 37const ( 38 // Disabled ... 39 Disabled AlertEmailNotificationStatus = "Disabled" 40 // Enabled ... 41 Enabled AlertEmailNotificationStatus = "Enabled" 42) 43 44// PossibleAlertEmailNotificationStatusValues returns an array of possible values for the AlertEmailNotificationStatus const type. 45func PossibleAlertEmailNotificationStatusValues() []AlertEmailNotificationStatus { 46 return []AlertEmailNotificationStatus{Disabled, Enabled} 47} 48 49// AlertScope enumerates the values for alert scope. 50type AlertScope string 51 52const ( 53 // AlertScopeDevice ... 54 AlertScopeDevice AlertScope = "Device" 55 // AlertScopeResource ... 56 AlertScopeResource AlertScope = "Resource" 57) 58 59// PossibleAlertScopeValues returns an array of possible values for the AlertScope const type. 60func PossibleAlertScopeValues() []AlertScope { 61 return []AlertScope{AlertScopeDevice, AlertScopeResource} 62} 63 64// AlertSeverity enumerates the values for alert severity. 65type AlertSeverity string 66 67const ( 68 // Critical ... 69 Critical AlertSeverity = "Critical" 70 // Informational ... 71 Informational AlertSeverity = "Informational" 72 // Warning ... 73 Warning AlertSeverity = "Warning" 74) 75 76// PossibleAlertSeverityValues returns an array of possible values for the AlertSeverity const type. 77func PossibleAlertSeverityValues() []AlertSeverity { 78 return []AlertSeverity{Critical, Informational, Warning} 79} 80 81// AlertSourceType enumerates the values for alert source type. 82type AlertSourceType string 83 84const ( 85 // AlertSourceTypeDevice ... 86 AlertSourceTypeDevice AlertSourceType = "Device" 87 // AlertSourceTypeResource ... 88 AlertSourceTypeResource AlertSourceType = "Resource" 89) 90 91// PossibleAlertSourceTypeValues returns an array of possible values for the AlertSourceType const type. 92func PossibleAlertSourceTypeValues() []AlertSourceType { 93 return []AlertSourceType{AlertSourceTypeDevice, AlertSourceTypeResource} 94} 95 96// AlertStatus enumerates the values for alert status. 97type AlertStatus string 98 99const ( 100 // Active ... 101 Active AlertStatus = "Active" 102 // Cleared ... 103 Cleared AlertStatus = "Cleared" 104) 105 106// PossibleAlertStatusValues returns an array of possible values for the AlertStatus const type. 107func PossibleAlertStatusValues() []AlertStatus { 108 return []AlertStatus{Active, Cleared} 109} 110 111// AuthType enumerates the values for auth type. 112type AuthType string 113 114const ( 115 // AccessControlService ... 116 AccessControlService AuthType = "AccessControlService" 117 // AzureActiveDirectory ... 118 AzureActiveDirectory AuthType = "AzureActiveDirectory" 119 // Invalid ... 120 Invalid AuthType = "Invalid" 121) 122 123// PossibleAuthTypeValues returns an array of possible values for the AuthType const type. 124func PossibleAuthTypeValues() []AuthType { 125 return []AuthType{AccessControlService, AzureActiveDirectory, Invalid} 126} 127 128// CloudType enumerates the values for cloud type. 129type CloudType string 130 131const ( 132 // Azure ... 133 Azure CloudType = "Azure" 134 // HP ... 135 HP CloudType = "HP" 136 // OpenStack ... 137 OpenStack CloudType = "OpenStack" 138 // S3 ... 139 S3 CloudType = "S3" 140 // S3RRS ... 141 S3RRS CloudType = "S3_RRS" 142) 143 144// PossibleCloudTypeValues returns an array of possible values for the CloudType const type. 145func PossibleCloudTypeValues() []CloudType { 146 return []CloudType{Azure, HP, OpenStack, S3, S3RRS} 147} 148 149// ContractVersions enumerates the values for contract versions. 150type ContractVersions string 151 152const ( 153 // InvalidVersion ... 154 InvalidVersion ContractVersions = "InvalidVersion" 155 // V201109 ... 156 V201109 ContractVersions = "V2011_09" 157 // V201202 ... 158 V201202 ContractVersions = "V2012_02" 159 // V201205 ... 160 V201205 ContractVersions = "V2012_05" 161 // V201212 ... 162 V201212 ContractVersions = "V2012_12" 163 // V201304 ... 164 V201304 ContractVersions = "V2013_04" 165 // V201310 ... 166 V201310 ContractVersions = "V2013_10" 167 // V201311 ... 168 V201311 ContractVersions = "V2013_11" 169 // V201404 ... 170 V201404 ContractVersions = "V2014_04" 171 // V201406 ... 172 V201406 ContractVersions = "V2014_06" 173 // V201407 ... 174 V201407 ContractVersions = "V2014_07" 175 // V201409 ... 176 V201409 ContractVersions = "V2014_09" 177 // V201410 ... 178 V201410 ContractVersions = "V2014_10" 179 // V201412 ... 180 V201412 ContractVersions = "V2014_12" 181 // V201501 ... 182 V201501 ContractVersions = "V2015_01" 183 // V201502 ... 184 V201502 ContractVersions = "V2015_02" 185 // V201504 ... 186 V201504 ContractVersions = "V2015_04" 187 // V201505 ... 188 V201505 ContractVersions = "V2015_05" 189 // V201506 ... 190 V201506 ContractVersions = "V2015_06" 191 // V201507 ... 192 V201507 ContractVersions = "V2015_07" 193 // V201508 ... 194 V201508 ContractVersions = "V2015_08" 195 // V201510 ... 196 V201510 ContractVersions = "V2015_10" 197 // V201512 ... 198 V201512 ContractVersions = "V2015_12" 199 // V201601 ... 200 V201601 ContractVersions = "V2016_01" 201 // V201602 ... 202 V201602 ContractVersions = "V2016_02" 203 // V201604 ... 204 V201604 ContractVersions = "V2016_04" 205 // V201605 ... 206 V201605 ContractVersions = "V2016_05" 207 // V201607 ... 208 V201607 ContractVersions = "V2016_07" 209 // V201608 ... 210 V201608 ContractVersions = "V2016_08" 211) 212 213// PossibleContractVersionsValues returns an array of possible values for the ContractVersions const type. 214func PossibleContractVersionsValues() []ContractVersions { 215 return []ContractVersions{InvalidVersion, V201109, V201202, V201205, V201212, V201304, V201310, V201311, V201404, V201406, V201407, V201409, V201410, V201412, V201501, V201502, V201504, V201505, V201506, V201507, V201508, V201510, V201512, V201601, V201602, V201604, V201605, V201607, V201608} 216} 217 218// DataPolicy enumerates the values for data policy. 219type DataPolicy string 220 221const ( 222 // DataPolicyCloud ... 223 DataPolicyCloud DataPolicy = "Cloud" 224 // DataPolicyInvalid ... 225 DataPolicyInvalid DataPolicy = "Invalid" 226 // DataPolicyLocal ... 227 DataPolicyLocal DataPolicy = "Local" 228 // DataPolicyTiered ... 229 DataPolicyTiered DataPolicy = "Tiered" 230) 231 232// PossibleDataPolicyValues returns an array of possible values for the DataPolicy const type. 233func PossibleDataPolicyValues() []DataPolicy { 234 return []DataPolicy{DataPolicyCloud, DataPolicyInvalid, DataPolicyLocal, DataPolicyTiered} 235} 236 237// DeviceConfigurationStatus enumerates the values for device configuration status. 238type DeviceConfigurationStatus string 239 240const ( 241 // Complete ... 242 Complete DeviceConfigurationStatus = "Complete" 243 // Pending ... 244 Pending DeviceConfigurationStatus = "Pending" 245) 246 247// PossibleDeviceConfigurationStatusValues returns an array of possible values for the DeviceConfigurationStatus const type. 248func PossibleDeviceConfigurationStatusValues() []DeviceConfigurationStatus { 249 return []DeviceConfigurationStatus{Complete, Pending} 250} 251 252// DeviceOperation enumerates the values for device operation. 253type DeviceOperation string 254 255const ( 256 // Browsable ... 257 Browsable DeviceOperation = "Browsable" 258 // Deactivate ... 259 Deactivate DeviceOperation = "Deactivate" 260 // Delete ... 261 Delete DeviceOperation = "Delete" 262 // DeleteWithWarning ... 263 DeleteWithWarning DeviceOperation = "DeleteWithWarning" 264 // DRSource ... 265 DRSource DeviceOperation = "DRSource" 266 // DRTarget ... 267 DRTarget DeviceOperation = "DRTarget" 268 // None ... 269 None DeviceOperation = "None" 270 // ReadOnlyForDR ... 271 ReadOnlyForDR DeviceOperation = "ReadOnlyForDR" 272) 273 274// PossibleDeviceOperationValues returns an array of possible values for the DeviceOperation const type. 275func PossibleDeviceOperationValues() []DeviceOperation { 276 return []DeviceOperation{Browsable, Deactivate, Delete, DeleteWithWarning, DRSource, DRTarget, None, ReadOnlyForDR} 277} 278 279// DeviceStatus enumerates the values for device status. 280type DeviceStatus string 281 282const ( 283 // Creating ... 284 Creating DeviceStatus = "Creating" 285 // Deactivated ... 286 Deactivated DeviceStatus = "Deactivated" 287 // Deactivating ... 288 Deactivating DeviceStatus = "Deactivating" 289 // Deleted ... 290 Deleted DeviceStatus = "Deleted" 291 // MaintenanceMode ... 292 MaintenanceMode DeviceStatus = "MaintenanceMode" 293 // Offline ... 294 Offline DeviceStatus = "Offline" 295 // Online ... 296 Online DeviceStatus = "Online" 297 // Provisioning ... 298 Provisioning DeviceStatus = "Provisioning" 299 // ReadyToSetup ... 300 ReadyToSetup DeviceStatus = "ReadyToSetup" 301 // RequiresAttention ... 302 RequiresAttention DeviceStatus = "RequiresAttention" 303 // Unknown ... 304 Unknown DeviceStatus = "Unknown" 305) 306 307// PossibleDeviceStatusValues returns an array of possible values for the DeviceStatus const type. 308func PossibleDeviceStatusValues() []DeviceStatus { 309 return []DeviceStatus{Creating, Deactivated, Deactivating, Deleted, MaintenanceMode, Offline, Online, Provisioning, ReadyToSetup, RequiresAttention, Unknown} 310} 311 312// DeviceType enumerates the values for device type. 313type DeviceType string 314 315const ( 316 // DeviceTypeAppliance ... 317 DeviceTypeAppliance DeviceType = "Appliance" 318 // DeviceTypeInvalid ... 319 DeviceTypeInvalid DeviceType = "Invalid" 320 // DeviceTypeSeries9000OnPremVirtualAppliance ... 321 DeviceTypeSeries9000OnPremVirtualAppliance DeviceType = "Series9000OnPremVirtualAppliance" 322 // DeviceTypeSeries9000PhysicalAppliance ... 323 DeviceTypeSeries9000PhysicalAppliance DeviceType = "Series9000PhysicalAppliance" 324 // DeviceTypeSeries9000VirtualAppliance ... 325 DeviceTypeSeries9000VirtualAppliance DeviceType = "Series9000VirtualAppliance" 326 // DeviceTypeVirtualAppliance ... 327 DeviceTypeVirtualAppliance DeviceType = "VirtualAppliance" 328) 329 330// PossibleDeviceTypeValues returns an array of possible values for the DeviceType const type. 331func PossibleDeviceTypeValues() []DeviceType { 332 return []DeviceType{DeviceTypeAppliance, DeviceTypeInvalid, DeviceTypeSeries9000OnPremVirtualAppliance, DeviceTypeSeries9000PhysicalAppliance, DeviceTypeSeries9000VirtualAppliance, DeviceTypeVirtualAppliance} 333} 334 335// DhcpStatus enumerates the values for dhcp status. 336type DhcpStatus string 337 338const ( 339 // DhcpStatusDisabled ... 340 DhcpStatusDisabled DhcpStatus = "Disabled" 341 // DhcpStatusEnabled ... 342 DhcpStatusEnabled DhcpStatus = "Enabled" 343) 344 345// PossibleDhcpStatusValues returns an array of possible values for the DhcpStatus const type. 346func PossibleDhcpStatusValues() []DhcpStatus { 347 return []DhcpStatus{DhcpStatusDisabled, DhcpStatusEnabled} 348} 349 350// DiskStatus enumerates the values for disk status. 351type DiskStatus string 352 353const ( 354 // DiskStatusOffline ... 355 DiskStatusOffline DiskStatus = "Offline" 356 // DiskStatusOnline ... 357 DiskStatusOnline DiskStatus = "Online" 358) 359 360// PossibleDiskStatusValues returns an array of possible values for the DiskStatus const type. 361func PossibleDiskStatusValues() []DiskStatus { 362 return []DiskStatus{DiskStatusOffline, DiskStatusOnline} 363} 364 365// DownloadPhase enumerates the values for download phase. 366type DownloadPhase string 367 368const ( 369 // DownloadPhaseDownloading ... 370 DownloadPhaseDownloading DownloadPhase = "Downloading" 371 // DownloadPhaseInitializing ... 372 DownloadPhaseInitializing DownloadPhase = "Initializing" 373 // DownloadPhaseUnknown ... 374 DownloadPhaseUnknown DownloadPhase = "Unknown" 375 // DownloadPhaseVerifying ... 376 DownloadPhaseVerifying DownloadPhase = "Verifying" 377) 378 379// PossibleDownloadPhaseValues returns an array of possible values for the DownloadPhase const type. 380func PossibleDownloadPhaseValues() []DownloadPhase { 381 return []DownloadPhase{DownloadPhaseDownloading, DownloadPhaseInitializing, DownloadPhaseUnknown, DownloadPhaseVerifying} 382} 383 384// EncryptionAlgorithm enumerates the values for encryption algorithm. 385type EncryptionAlgorithm string 386 387const ( 388 // EncryptionAlgorithmAES256 ... 389 EncryptionAlgorithmAES256 EncryptionAlgorithm = "AES256" 390 // EncryptionAlgorithmNone ... 391 EncryptionAlgorithmNone EncryptionAlgorithm = "None" 392 // EncryptionAlgorithmRSAESPKCS1V15 ... 393 EncryptionAlgorithmRSAESPKCS1V15 EncryptionAlgorithm = "RSAES_PKCS1_v_1_5" 394) 395 396// PossibleEncryptionAlgorithmValues returns an array of possible values for the EncryptionAlgorithm const type. 397func PossibleEncryptionAlgorithmValues() []EncryptionAlgorithm { 398 return []EncryptionAlgorithm{EncryptionAlgorithmAES256, EncryptionAlgorithmNone, EncryptionAlgorithmRSAESPKCS1V15} 399} 400 401// EncryptionStatus enumerates the values for encryption status. 402type EncryptionStatus string 403 404const ( 405 // EncryptionStatusDisabled ... 406 EncryptionStatusDisabled EncryptionStatus = "Disabled" 407 // EncryptionStatusEnabled ... 408 EncryptionStatusEnabled EncryptionStatus = "Enabled" 409) 410 411// PossibleEncryptionStatusValues returns an array of possible values for the EncryptionStatus const type. 412func PossibleEncryptionStatusValues() []EncryptionStatus { 413 return []EncryptionStatus{EncryptionStatusDisabled, EncryptionStatusEnabled} 414} 415 416// InitiatedBy enumerates the values for initiated by. 417type InitiatedBy string 418 419const ( 420 // Manual ... 421 Manual InitiatedBy = "Manual" 422 // Scheduled ... 423 Scheduled InitiatedBy = "Scheduled" 424) 425 426// PossibleInitiatedByValues returns an array of possible values for the InitiatedBy const type. 427func PossibleInitiatedByValues() []InitiatedBy { 428 return []InitiatedBy{Manual, Scheduled} 429} 430 431// JobStatus enumerates the values for job status. 432type JobStatus string 433 434const ( 435 // JobStatusCanceled ... 436 JobStatusCanceled JobStatus = "Canceled" 437 // JobStatusFailed ... 438 JobStatusFailed JobStatus = "Failed" 439 // JobStatusInvalid ... 440 JobStatusInvalid JobStatus = "Invalid" 441 // JobStatusPaused ... 442 JobStatusPaused JobStatus = "Paused" 443 // JobStatusRunning ... 444 JobStatusRunning JobStatus = "Running" 445 // JobStatusScheduled ... 446 JobStatusScheduled JobStatus = "Scheduled" 447 // JobStatusSucceeded ... 448 JobStatusSucceeded JobStatus = "Succeeded" 449) 450 451// PossibleJobStatusValues returns an array of possible values for the JobStatus const type. 452func PossibleJobStatusValues() []JobStatus { 453 return []JobStatus{JobStatusCanceled, JobStatusFailed, JobStatusInvalid, JobStatusPaused, JobStatusRunning, JobStatusScheduled, JobStatusSucceeded} 454} 455 456// JobType enumerates the values for job type. 457type JobType string 458 459const ( 460 // JobTypeBackup ... 461 JobTypeBackup JobType = "Backup" 462 // JobTypeClone ... 463 JobTypeClone JobType = "Clone" 464 // JobTypeDownloadUpdates ... 465 JobTypeDownloadUpdates JobType = "DownloadUpdates" 466 // JobTypeFailover ... 467 JobTypeFailover JobType = "Failover" 468 // JobTypeInstallUpdates ... 469 JobTypeInstallUpdates JobType = "InstallUpdates" 470) 471 472// PossibleJobTypeValues returns an array of possible values for the JobType const type. 473func PossibleJobTypeValues() []JobType { 474 return []JobType{JobTypeBackup, JobTypeClone, JobTypeDownloadUpdates, JobTypeFailover, JobTypeInstallUpdates} 475} 476 477// KeyRolloverStatus enumerates the values for key rollover status. 478type KeyRolloverStatus string 479 480const ( 481 // NotRequired ... 482 NotRequired KeyRolloverStatus = "NotRequired" 483 // Required ... 484 Required KeyRolloverStatus = "Required" 485) 486 487// PossibleKeyRolloverStatusValues returns an array of possible values for the KeyRolloverStatus const type. 488func PossibleKeyRolloverStatusValues() []KeyRolloverStatus { 489 return []KeyRolloverStatus{NotRequired, Required} 490} 491 492// ManagerType enumerates the values for manager type. 493type ManagerType string 494 495const ( 496 // GardaV1 ... 497 GardaV1 ManagerType = "GardaV1" 498 // HelsinkiV1 ... 499 HelsinkiV1 ManagerType = "HelsinkiV1" 500) 501 502// PossibleManagerTypeValues returns an array of possible values for the ManagerType const type. 503func PossibleManagerTypeValues() []ManagerType { 504 return []ManagerType{GardaV1, HelsinkiV1} 505} 506 507// MetricAggregationType enumerates the values for metric aggregation type. 508type MetricAggregationType string 509 510const ( 511 // MetricAggregationTypeAverage ... 512 MetricAggregationTypeAverage MetricAggregationType = "Average" 513 // MetricAggregationTypeLast ... 514 MetricAggregationTypeLast MetricAggregationType = "Last" 515 // MetricAggregationTypeMaximum ... 516 MetricAggregationTypeMaximum MetricAggregationType = "Maximum" 517 // MetricAggregationTypeMinimum ... 518 MetricAggregationTypeMinimum MetricAggregationType = "Minimum" 519 // MetricAggregationTypeNone ... 520 MetricAggregationTypeNone MetricAggregationType = "None" 521 // MetricAggregationTypeTotal ... 522 MetricAggregationTypeTotal MetricAggregationType = "Total" 523) 524 525// PossibleMetricAggregationTypeValues returns an array of possible values for the MetricAggregationType const type. 526func PossibleMetricAggregationTypeValues() []MetricAggregationType { 527 return []MetricAggregationType{MetricAggregationTypeAverage, MetricAggregationTypeLast, MetricAggregationTypeMaximum, MetricAggregationTypeMinimum, MetricAggregationTypeNone, MetricAggregationTypeTotal} 528} 529 530// MetricUnit enumerates the values for metric unit. 531type MetricUnit string 532 533const ( 534 // Bytes ... 535 Bytes MetricUnit = "Bytes" 536 // BytesPerSecond ... 537 BytesPerSecond MetricUnit = "BytesPerSecond" 538 // Count ... 539 Count MetricUnit = "Count" 540 // CountPerSecond ... 541 CountPerSecond MetricUnit = "CountPerSecond" 542 // Percent ... 543 Percent MetricUnit = "Percent" 544 // Seconds ... 545 Seconds MetricUnit = "Seconds" 546) 547 548// PossibleMetricUnitValues returns an array of possible values for the MetricUnit const type. 549func PossibleMetricUnitValues() []MetricUnit { 550 return []MetricUnit{Bytes, BytesPerSecond, Count, CountPerSecond, Percent, Seconds} 551} 552 553// MonitoringStatus enumerates the values for monitoring status. 554type MonitoringStatus string 555 556const ( 557 // MonitoringStatusDisabled ... 558 MonitoringStatusDisabled MonitoringStatus = "Disabled" 559 // MonitoringStatusEnabled ... 560 MonitoringStatusEnabled MonitoringStatus = "Enabled" 561) 562 563// PossibleMonitoringStatusValues returns an array of possible values for the MonitoringStatus const type. 564func PossibleMonitoringStatusValues() []MonitoringStatus { 565 return []MonitoringStatus{MonitoringStatusDisabled, MonitoringStatusEnabled} 566} 567 568// ServiceOwnersAlertNotificationStatus enumerates the values for service owners alert notification status. 569type ServiceOwnersAlertNotificationStatus string 570 571const ( 572 // ServiceOwnersAlertNotificationStatusDisabled ... 573 ServiceOwnersAlertNotificationStatusDisabled ServiceOwnersAlertNotificationStatus = "Disabled" 574 // ServiceOwnersAlertNotificationStatusEnabled ... 575 ServiceOwnersAlertNotificationStatusEnabled ServiceOwnersAlertNotificationStatus = "Enabled" 576) 577 578// PossibleServiceOwnersAlertNotificationStatusValues returns an array of possible values for the ServiceOwnersAlertNotificationStatus const type. 579func PossibleServiceOwnersAlertNotificationStatusValues() []ServiceOwnersAlertNotificationStatus { 580 return []ServiceOwnersAlertNotificationStatus{ServiceOwnersAlertNotificationStatusDisabled, ServiceOwnersAlertNotificationStatusEnabled} 581} 582 583// ShareStatus enumerates the values for share status. 584type ShareStatus string 585 586const ( 587 // ShareStatusOffline ... 588 ShareStatusOffline ShareStatus = "Offline" 589 // ShareStatusOnline ... 590 ShareStatusOnline ShareStatus = "Online" 591) 592 593// PossibleShareStatusValues returns an array of possible values for the ShareStatus const type. 594func PossibleShareStatusValues() []ShareStatus { 595 return []ShareStatus{ShareStatusOffline, ShareStatusOnline} 596} 597 598// SslStatus enumerates the values for ssl status. 599type SslStatus string 600 601const ( 602 // SslStatusDisabled ... 603 SslStatusDisabled SslStatus = "Disabled" 604 // SslStatusEnabled ... 605 SslStatusEnabled SslStatus = "Enabled" 606) 607 608// PossibleSslStatusValues returns an array of possible values for the SslStatus const type. 609func PossibleSslStatusValues() []SslStatus { 610 return []SslStatus{SslStatusDisabled, SslStatusEnabled} 611} 612 613// SupportedDeviceCapabilities enumerates the values for supported device capabilities. 614type SupportedDeviceCapabilities string 615 616const ( 617 // SupportedDeviceCapabilitiesFileServer ... 618 SupportedDeviceCapabilitiesFileServer SupportedDeviceCapabilities = "FileServer" 619 // SupportedDeviceCapabilitiesInvalid ... 620 SupportedDeviceCapabilitiesInvalid SupportedDeviceCapabilities = "Invalid" 621 // SupportedDeviceCapabilitiesIscsiServer ... 622 SupportedDeviceCapabilitiesIscsiServer SupportedDeviceCapabilities = "IscsiServer" 623) 624 625// PossibleSupportedDeviceCapabilitiesValues returns an array of possible values for the SupportedDeviceCapabilities const type. 626func PossibleSupportedDeviceCapabilitiesValues() []SupportedDeviceCapabilities { 627 return []SupportedDeviceCapabilities{SupportedDeviceCapabilitiesFileServer, SupportedDeviceCapabilitiesInvalid, SupportedDeviceCapabilitiesIscsiServer} 628} 629 630// TargetType enumerates the values for target type. 631type TargetType string 632 633const ( 634 // TargetTypeDiskServer ... 635 TargetTypeDiskServer TargetType = "DiskServer" 636 // TargetTypeFileServer ... 637 TargetTypeFileServer TargetType = "FileServer" 638) 639 640// PossibleTargetTypeValues returns an array of possible values for the TargetType const type. 641func PossibleTargetTypeValues() []TargetType { 642 return []TargetType{TargetTypeDiskServer, TargetTypeFileServer} 643} 644 645// UpdateOperation enumerates the values for update operation. 646type UpdateOperation string 647 648const ( 649 // Downloading ... 650 Downloading UpdateOperation = "Downloading" 651 // Idle ... 652 Idle UpdateOperation = "Idle" 653 // Installing ... 654 Installing UpdateOperation = "Installing" 655 // Scanning ... 656 Scanning UpdateOperation = "Scanning" 657) 658 659// PossibleUpdateOperationValues returns an array of possible values for the UpdateOperation const type. 660func PossibleUpdateOperationValues() []UpdateOperation { 661 return []UpdateOperation{Downloading, Idle, Installing, Scanning} 662} 663 664// AccessControlRecord the access control record 665type AccessControlRecord struct { 666 autorest.Response `json:"-"` 667 // AccessControlRecordProperties - Properties of AccessControlRecord 668 *AccessControlRecordProperties `json:"properties,omitempty"` 669 // ID - READ-ONLY; The identifier. 670 ID *string `json:"id,omitempty"` 671 // Name - READ-ONLY; The name. 672 Name *string `json:"name,omitempty"` 673 // Type - READ-ONLY; The type. 674 Type *string `json:"type,omitempty"` 675} 676 677// MarshalJSON is the custom marshaler for AccessControlRecord. 678func (acr AccessControlRecord) MarshalJSON() ([]byte, error) { 679 objectMap := make(map[string]interface{}) 680 if acr.AccessControlRecordProperties != nil { 681 objectMap["properties"] = acr.AccessControlRecordProperties 682 } 683 return json.Marshal(objectMap) 684} 685 686// UnmarshalJSON is the custom unmarshaler for AccessControlRecord struct. 687func (acr *AccessControlRecord) UnmarshalJSON(body []byte) error { 688 var m map[string]*json.RawMessage 689 err := json.Unmarshal(body, &m) 690 if err != nil { 691 return err 692 } 693 for k, v := range m { 694 switch k { 695 case "properties": 696 if v != nil { 697 var accessControlRecordProperties AccessControlRecordProperties 698 err = json.Unmarshal(*v, &accessControlRecordProperties) 699 if err != nil { 700 return err 701 } 702 acr.AccessControlRecordProperties = &accessControlRecordProperties 703 } 704 case "id": 705 if v != nil { 706 var ID string 707 err = json.Unmarshal(*v, &ID) 708 if err != nil { 709 return err 710 } 711 acr.ID = &ID 712 } 713 case "name": 714 if v != nil { 715 var name string 716 err = json.Unmarshal(*v, &name) 717 if err != nil { 718 return err 719 } 720 acr.Name = &name 721 } 722 case "type": 723 if v != nil { 724 var typeVar string 725 err = json.Unmarshal(*v, &typeVar) 726 if err != nil { 727 return err 728 } 729 acr.Type = &typeVar 730 } 731 } 732 } 733 734 return nil 735} 736 737// AccessControlRecordList collection of AccessControlRecords 738type AccessControlRecordList struct { 739 autorest.Response `json:"-"` 740 // Value - The value. 741 Value *[]AccessControlRecord `json:"value,omitempty"` 742} 743 744// AccessControlRecordProperties properties of access control record 745type AccessControlRecordProperties struct { 746 // InitiatorName - The Iscsi initiator name (IQN) 747 InitiatorName *string `json:"initiatorName,omitempty"` 748} 749 750// AccessControlRecordsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 751// long-running operation. 752type AccessControlRecordsCreateOrUpdateFuture struct { 753 azure.Future 754} 755 756// Result returns the result of the asynchronous operation. 757// If the operation has not completed it will return an error. 758func (future *AccessControlRecordsCreateOrUpdateFuture) Result(client AccessControlRecordsClient) (acr AccessControlRecord, err error) { 759 var done bool 760 done, err = future.DoneWithContext(context.Background(), client) 761 if err != nil { 762 err = autorest.NewErrorWithError(err, "storsimple.AccessControlRecordsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 763 return 764 } 765 if !done { 766 err = azure.NewAsyncOpIncompleteError("storsimple.AccessControlRecordsCreateOrUpdateFuture") 767 return 768 } 769 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 770 if acr.Response.Response, err = future.GetResult(sender); err == nil && acr.Response.Response.StatusCode != http.StatusNoContent { 771 acr, err = client.CreateOrUpdateResponder(acr.Response.Response) 772 if err != nil { 773 err = autorest.NewErrorWithError(err, "storsimple.AccessControlRecordsCreateOrUpdateFuture", "Result", acr.Response.Response, "Failure responding to request") 774 } 775 } 776 return 777} 778 779// AccessControlRecordsDeleteFuture an abstraction for monitoring and retrieving the results of a 780// long-running operation. 781type AccessControlRecordsDeleteFuture struct { 782 azure.Future 783} 784 785// Result returns the result of the asynchronous operation. 786// If the operation has not completed it will return an error. 787func (future *AccessControlRecordsDeleteFuture) Result(client AccessControlRecordsClient) (ar autorest.Response, err error) { 788 var done bool 789 done, err = future.DoneWithContext(context.Background(), client) 790 if err != nil { 791 err = autorest.NewErrorWithError(err, "storsimple.AccessControlRecordsDeleteFuture", "Result", future.Response(), "Polling failure") 792 return 793 } 794 if !done { 795 err = azure.NewAsyncOpIncompleteError("storsimple.AccessControlRecordsDeleteFuture") 796 return 797 } 798 ar.Response = future.Response() 799 return 800} 801 802// Alert alert class 803type Alert struct { 804 // AlertProperties - Properties of alert 805 *AlertProperties `json:"properties,omitempty"` 806 // ID - READ-ONLY; The identifier. 807 ID *string `json:"id,omitempty"` 808 // Name - READ-ONLY; The name. 809 Name *string `json:"name,omitempty"` 810 // Type - READ-ONLY; The type. 811 Type *string `json:"type,omitempty"` 812} 813 814// MarshalJSON is the custom marshaler for Alert. 815func (a Alert) MarshalJSON() ([]byte, error) { 816 objectMap := make(map[string]interface{}) 817 if a.AlertProperties != nil { 818 objectMap["properties"] = a.AlertProperties 819 } 820 return json.Marshal(objectMap) 821} 822 823// UnmarshalJSON is the custom unmarshaler for Alert struct. 824func (a *Alert) UnmarshalJSON(body []byte) error { 825 var m map[string]*json.RawMessage 826 err := json.Unmarshal(body, &m) 827 if err != nil { 828 return err 829 } 830 for k, v := range m { 831 switch k { 832 case "properties": 833 if v != nil { 834 var alertProperties AlertProperties 835 err = json.Unmarshal(*v, &alertProperties) 836 if err != nil { 837 return err 838 } 839 a.AlertProperties = &alertProperties 840 } 841 case "id": 842 if v != nil { 843 var ID string 844 err = json.Unmarshal(*v, &ID) 845 if err != nil { 846 return err 847 } 848 a.ID = &ID 849 } 850 case "name": 851 if v != nil { 852 var name string 853 err = json.Unmarshal(*v, &name) 854 if err != nil { 855 return err 856 } 857 a.Name = &name 858 } 859 case "type": 860 if v != nil { 861 var typeVar string 862 err = json.Unmarshal(*v, &typeVar) 863 if err != nil { 864 return err 865 } 866 a.Type = &typeVar 867 } 868 } 869 } 870 871 return nil 872} 873 874// AlertErrorDetails error details for the alert 875type AlertErrorDetails struct { 876 // ErrorCode - Error code. 877 ErrorCode *string `json:"errorCode,omitempty"` 878 // ErrorMessage - Error Message 879 ErrorMessage *string `json:"errorMessage,omitempty"` 880 // Occurences - Number of occurrences. 881 Occurences *int32 `json:"occurences,omitempty"` 882} 883 884// AlertFilter filters that can be specified on the alert 885type AlertFilter struct { 886 // Status - Status of the alert. Possible values include: 'Active', 'Cleared' 887 Status AlertStatus `json:"status,omitempty"` 888 // Severity - Severity of the alert. Possible values include: 'Informational', 'Warning', 'Critical' 889 Severity AlertSeverity `json:"severity,omitempty"` 890 // SourceType - Source of the alert. Possible values include: 'AlertSourceTypeResource', 'AlertSourceTypeDevice' 891 SourceType AlertSourceType `json:"sourceType,omitempty"` 892 // SourceName - Source name of the alert 893 SourceName *string `json:"sourceName,omitempty"` 894 // AppearedOnTime - UTC time on which the alert appeared 895 AppearedOnTime *date.Time `json:"appearedOnTime,omitempty"` 896} 897 898// AlertList collection of Alerts 899type AlertList struct { 900 autorest.Response `json:"-"` 901 // Value - The value. 902 Value *[]Alert `json:"value,omitempty"` 903 // NextLink - Id of the next page of alerts 904 NextLink *string `json:"nextLink,omitempty"` 905} 906 907// AlertListIterator provides access to a complete listing of Alert values. 908type AlertListIterator struct { 909 i int 910 page AlertListPage 911} 912 913// NextWithContext advances to the next value. If there was an error making 914// the request the iterator does not advance and the error is returned. 915func (iter *AlertListIterator) NextWithContext(ctx context.Context) (err error) { 916 if tracing.IsEnabled() { 917 ctx = tracing.StartSpan(ctx, fqdn+"/AlertListIterator.NextWithContext") 918 defer func() { 919 sc := -1 920 if iter.Response().Response.Response != nil { 921 sc = iter.Response().Response.Response.StatusCode 922 } 923 tracing.EndSpan(ctx, sc, err) 924 }() 925 } 926 iter.i++ 927 if iter.i < len(iter.page.Values()) { 928 return nil 929 } 930 err = iter.page.NextWithContext(ctx) 931 if err != nil { 932 iter.i-- 933 return err 934 } 935 iter.i = 0 936 return nil 937} 938 939// Next advances to the next value. If there was an error making 940// the request the iterator does not advance and the error is returned. 941// Deprecated: Use NextWithContext() instead. 942func (iter *AlertListIterator) Next() error { 943 return iter.NextWithContext(context.Background()) 944} 945 946// NotDone returns true if the enumeration should be started or is not yet complete. 947func (iter AlertListIterator) NotDone() bool { 948 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 949} 950 951// Response returns the raw server response from the last page request. 952func (iter AlertListIterator) Response() AlertList { 953 return iter.page.Response() 954} 955 956// Value returns the current value or a zero-initialized value if the 957// iterator has advanced beyond the end of the collection. 958func (iter AlertListIterator) Value() Alert { 959 if !iter.page.NotDone() { 960 return Alert{} 961 } 962 return iter.page.Values()[iter.i] 963} 964 965// Creates a new instance of the AlertListIterator type. 966func NewAlertListIterator(page AlertListPage) AlertListIterator { 967 return AlertListIterator{page: page} 968} 969 970// IsEmpty returns true if the ListResult contains no values. 971func (al AlertList) IsEmpty() bool { 972 return al.Value == nil || len(*al.Value) == 0 973} 974 975// alertListPreparer prepares a request to retrieve the next set of results. 976// It returns nil if no more results exist. 977func (al AlertList) alertListPreparer(ctx context.Context) (*http.Request, error) { 978 if al.NextLink == nil || len(to.String(al.NextLink)) < 1 { 979 return nil, nil 980 } 981 return autorest.Prepare((&http.Request{}).WithContext(ctx), 982 autorest.AsJSON(), 983 autorest.AsGet(), 984 autorest.WithBaseURL(to.String(al.NextLink))) 985} 986 987// AlertListPage contains a page of Alert values. 988type AlertListPage struct { 989 fn func(context.Context, AlertList) (AlertList, error) 990 al AlertList 991} 992 993// NextWithContext advances to the next page of values. If there was an error making 994// the request the page does not advance and the error is returned. 995func (page *AlertListPage) NextWithContext(ctx context.Context) (err error) { 996 if tracing.IsEnabled() { 997 ctx = tracing.StartSpan(ctx, fqdn+"/AlertListPage.NextWithContext") 998 defer func() { 999 sc := -1 1000 if page.Response().Response.Response != nil { 1001 sc = page.Response().Response.Response.StatusCode 1002 } 1003 tracing.EndSpan(ctx, sc, err) 1004 }() 1005 } 1006 next, err := page.fn(ctx, page.al) 1007 if err != nil { 1008 return err 1009 } 1010 page.al = next 1011 return nil 1012} 1013 1014// Next advances to the next page of values. If there was an error making 1015// the request the page does not advance and the error is returned. 1016// Deprecated: Use NextWithContext() instead. 1017func (page *AlertListPage) Next() error { 1018 return page.NextWithContext(context.Background()) 1019} 1020 1021// NotDone returns true if the page enumeration should be started or is not yet complete. 1022func (page AlertListPage) NotDone() bool { 1023 return !page.al.IsEmpty() 1024} 1025 1026// Response returns the raw server response from the last page request. 1027func (page AlertListPage) Response() AlertList { 1028 return page.al 1029} 1030 1031// Values returns the slice of values for the current page or nil if there are no values. 1032func (page AlertListPage) Values() []Alert { 1033 if page.al.IsEmpty() { 1034 return nil 1035 } 1036 return *page.al.Value 1037} 1038 1039// Creates a new instance of the AlertListPage type. 1040func NewAlertListPage(getNextPage func(context.Context, AlertList) (AlertList, error)) AlertListPage { 1041 return AlertListPage{fn: getNextPage} 1042} 1043 1044// AlertProperties properties of alert 1045type AlertProperties struct { 1046 // Title - Title of the alert 1047 Title *string `json:"title,omitempty"` 1048 // Scope - Device or Resource alert. Possible values include: 'AlertScopeResource', 'AlertScopeDevice' 1049 Scope AlertScope `json:"scope,omitempty"` 1050 // AlertType - Type of the alert 1051 AlertType *string `json:"alertType,omitempty"` 1052 // AppearedAtTime - UTC time at which the alert appeared 1053 AppearedAtTime *date.Time `json:"appearedAtTime,omitempty"` 1054 // AppearedAtSourceTime - UTC time at which the alert appeared on the source 1055 AppearedAtSourceTime *date.Time `json:"appearedAtSourceTime,omitempty"` 1056 // ClearedAtTime - UTC time at which the alert got cleared 1057 ClearedAtTime *date.Time `json:"clearedAtTime,omitempty"` 1058 // ClearedAtSourceTime - UTC time at which the alert was cleared on the source 1059 ClearedAtSourceTime *date.Time `json:"clearedAtSourceTime,omitempty"` 1060 // Source - Source at which the alert was cleared 1061 Source *AlertSource `json:"source,omitempty"` 1062 // Recommendation - Recommendation for acting on the alert 1063 Recommendation *string `json:"recommendation,omitempty"` 1064 // ResolutionReason - Reason for resolving the alert 1065 ResolutionReason *string `json:"resolutionReason,omitempty"` 1066 // Severity - Severity of the alert. Possible values include: 'Informational', 'Warning', 'Critical' 1067 Severity AlertSeverity `json:"severity,omitempty"` 1068 // Status - Current status of the alert. Possible values include: 'Active', 'Cleared' 1069 Status AlertStatus `json:"status,omitempty"` 1070 // ErrorDetails - ErrorDetails of the alert 1071 ErrorDetails *AlertErrorDetails `json:"errorDetails,omitempty"` 1072 // DetailedInformation - Other information about the alert 1073 DetailedInformation map[string]*string `json:"detailedInformation"` 1074} 1075 1076// MarshalJSON is the custom marshaler for AlertProperties. 1077func (ap AlertProperties) MarshalJSON() ([]byte, error) { 1078 objectMap := make(map[string]interface{}) 1079 if ap.Title != nil { 1080 objectMap["title"] = ap.Title 1081 } 1082 if ap.Scope != "" { 1083 objectMap["scope"] = ap.Scope 1084 } 1085 if ap.AlertType != nil { 1086 objectMap["alertType"] = ap.AlertType 1087 } 1088 if ap.AppearedAtTime != nil { 1089 objectMap["appearedAtTime"] = ap.AppearedAtTime 1090 } 1091 if ap.AppearedAtSourceTime != nil { 1092 objectMap["appearedAtSourceTime"] = ap.AppearedAtSourceTime 1093 } 1094 if ap.ClearedAtTime != nil { 1095 objectMap["clearedAtTime"] = ap.ClearedAtTime 1096 } 1097 if ap.ClearedAtSourceTime != nil { 1098 objectMap["clearedAtSourceTime"] = ap.ClearedAtSourceTime 1099 } 1100 if ap.Source != nil { 1101 objectMap["source"] = ap.Source 1102 } 1103 if ap.Recommendation != nil { 1104 objectMap["recommendation"] = ap.Recommendation 1105 } 1106 if ap.ResolutionReason != nil { 1107 objectMap["resolutionReason"] = ap.ResolutionReason 1108 } 1109 if ap.Severity != "" { 1110 objectMap["severity"] = ap.Severity 1111 } 1112 if ap.Status != "" { 1113 objectMap["status"] = ap.Status 1114 } 1115 if ap.ErrorDetails != nil { 1116 objectMap["errorDetails"] = ap.ErrorDetails 1117 } 1118 if ap.DetailedInformation != nil { 1119 objectMap["detailedInformation"] = ap.DetailedInformation 1120 } 1121 return json.Marshal(objectMap) 1122} 1123 1124// AlertSettings alertSettings on the device which represents how alerts will be processed 1125type AlertSettings struct { 1126 autorest.Response `json:"-"` 1127 // AlertSettingsProperties - Properties of AlertSettings 1128 *AlertSettingsProperties `json:"properties,omitempty"` 1129 // ID - READ-ONLY; The identifier. 1130 ID *string `json:"id,omitempty"` 1131 // Name - READ-ONLY; The name. 1132 Name *string `json:"name,omitempty"` 1133 // Type - READ-ONLY; The type. 1134 Type *string `json:"type,omitempty"` 1135} 1136 1137// MarshalJSON is the custom marshaler for AlertSettings. 1138func (as AlertSettings) MarshalJSON() ([]byte, error) { 1139 objectMap := make(map[string]interface{}) 1140 if as.AlertSettingsProperties != nil { 1141 objectMap["properties"] = as.AlertSettingsProperties 1142 } 1143 return json.Marshal(objectMap) 1144} 1145 1146// UnmarshalJSON is the custom unmarshaler for AlertSettings struct. 1147func (as *AlertSettings) UnmarshalJSON(body []byte) error { 1148 var m map[string]*json.RawMessage 1149 err := json.Unmarshal(body, &m) 1150 if err != nil { 1151 return err 1152 } 1153 for k, v := range m { 1154 switch k { 1155 case "properties": 1156 if v != nil { 1157 var alertSettingsProperties AlertSettingsProperties 1158 err = json.Unmarshal(*v, &alertSettingsProperties) 1159 if err != nil { 1160 return err 1161 } 1162 as.AlertSettingsProperties = &alertSettingsProperties 1163 } 1164 case "id": 1165 if v != nil { 1166 var ID string 1167 err = json.Unmarshal(*v, &ID) 1168 if err != nil { 1169 return err 1170 } 1171 as.ID = &ID 1172 } 1173 case "name": 1174 if v != nil { 1175 var name string 1176 err = json.Unmarshal(*v, &name) 1177 if err != nil { 1178 return err 1179 } 1180 as.Name = &name 1181 } 1182 case "type": 1183 if v != nil { 1184 var typeVar string 1185 err = json.Unmarshal(*v, &typeVar) 1186 if err != nil { 1187 return err 1188 } 1189 as.Type = &typeVar 1190 } 1191 } 1192 } 1193 1194 return nil 1195} 1196 1197// AlertSettingsProperties class containing the properties of AlertSettings 1198type AlertSettingsProperties struct { 1199 // EmailNotification - Value indicating whether user/admins will receive emails when an alert condition occurs on the system. Possible values include: 'Enabled', 'Disabled' 1200 EmailNotification AlertEmailNotificationStatus `json:"emailNotification,omitempty"` 1201 // NotificationToServiceOwners - Value indicating whether service owners will receive emails when an alert condition occurs on the system. Applicable only if emailNotification flag is Enabled. Possible values include: 'ServiceOwnersAlertNotificationStatusEnabled', 'ServiceOwnersAlertNotificationStatusDisabled' 1202 NotificationToServiceOwners ServiceOwnersAlertNotificationStatus `json:"notificationToServiceOwners,omitempty"` 1203 // AlertNotificationCulture - Culture setting to be used while building alert emails. For eg: "en-US" 1204 AlertNotificationCulture *string `json:"alertNotificationCulture,omitempty"` 1205 // AdditionalRecipientEmailList - List of email addresses (apart from admin/co-admin of subscription) to whom the alert emails need to be sent 1206 AdditionalRecipientEmailList *[]string `json:"additionalRecipientEmailList,omitempty"` 1207} 1208 1209// AlertSource source at which the alert can be raised 1210type AlertSource struct { 1211 // Name - Name of the source. 1212 Name *string `json:"name,omitempty"` 1213 // TimeZone - The time zone. 1214 TimeZone *string `json:"timeZone,omitempty"` 1215 // AlertSourceType - Source type of the alert. Possible values include: 'AlertSourceTypeResource', 'AlertSourceTypeDevice' 1216 AlertSourceType AlertSourceType `json:"alertSourceType,omitempty"` 1217} 1218 1219// AsymmetricEncryptedSecret this class can be used as the Type for any secret entity represented as 1220// Password, CertThumbprint, Algorithm. This class is intended to be used when the secret is encrypted with 1221// an asymmetric key pair. The encryptionAlgorithm field is mainly for future usage to potentially allow 1222// different entities encrypted using different algorithms. 1223type AsymmetricEncryptedSecret struct { 1224 // Value - The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint will be null. 1225 Value *string `json:"value,omitempty"` 1226 // EncryptionCertificateThumbprint - Thumbprint certificate that was used to encrypt "Value" 1227 EncryptionCertificateThumbprint *string `json:"encryptionCertificateThumbprint,omitempty"` 1228 // EncryptionAlgorithm - Algorithm used to encrypt "Value". Possible values include: 'EncryptionAlgorithmNone', 'EncryptionAlgorithmAES256', 'EncryptionAlgorithmRSAESPKCS1V15' 1229 EncryptionAlgorithm EncryptionAlgorithm `json:"encryptionAlgorithm,omitempty"` 1230} 1231 1232// AvailableProviderOperation class represents provider operation 1233type AvailableProviderOperation struct { 1234 // Name - Gets or sets the name of the operation being performed on this particular object 1235 // Return value format: "{resourceProviderNamespace}/{resourceType}/{read|write|deletion|action}" 1236 // Eg: Microsoft.StorSimple/managers/devices/fileServers/read 1237 // Microsoft.StorSimple/managers/devices/alerts/clearAlerts/action 1238 Name *string `json:"name,omitempty"` 1239 // Display - Gets or sets Display information 1240 // Contains the localized display information for this particular operation/action 1241 Display *AvailableProviderOperationDisplay `json:"display,omitempty"` 1242 // Origin - Gets or sets Origin 1243 // The intended executor of the operation; governs the display of the operation in the RBAC UX and the audit logs UX. 1244 // Default value is “user,system” 1245 Origin *string `json:"origin,omitempty"` 1246 // Properties - Gets or sets Properties 1247 // Reserved for future use 1248 Properties interface{} `json:"properties,omitempty"` 1249} 1250 1251// AvailableProviderOperationDisplay contains the localized display information for this particular 1252// operation / action. 1253// These value will be used by several clients for 1254// (1) custom role definitions for RBAC; 1255// (2) complex query filters for the event service; and (3) audit history / records for management 1256// operations. 1257type AvailableProviderOperationDisplay struct { 1258 // Provider - Gets or sets Provider 1259 // The localized friendly form of the resource provider name – it is expected to also include the publisher/company responsible. 1260 // It should use Title Casing and begin with “Microsoft” for 1st party services. 1261 Provider *string `json:"provider,omitempty"` 1262 // Resource - Gets or sets Resource 1263 // The localized friendly form of the resource type related to this action/operation – it should match the public documentation for the resource provider. 1264 // It should use Title Casing – for examples, please refer to the “name” section. 1265 Resource *string `json:"resource,omitempty"` 1266 // Operation - Gets or sets Operation 1267 // The localized friendly name for the operation, as it should be shown to the user. 1268 // It should be concise (to fit in drop downs) but clear (i.e. self-documenting). It should use Title Casing and include the entity/resource to which it applies. 1269 Operation *string `json:"operation,omitempty"` 1270 // Description - Gets or sets Description 1271 // The localized friendly description for the operation, as it should be shown to the user. 1272 // It should be thorough, yet concise – it will be used in tool tips and detailed views. 1273 Description *string `json:"description,omitempty"` 1274} 1275 1276// AvailableProviderOperations class for set of operations used for discovery of available provider 1277// operations. 1278type AvailableProviderOperations struct { 1279 autorest.Response `json:"-"` 1280 // Value - The value. 1281 Value *[]AvailableProviderOperation `json:"value,omitempty"` 1282 // NextLink - The NextLink. 1283 NextLink *string `json:"nextLink,omitempty"` 1284} 1285 1286// AvailableProviderOperationsIterator provides access to a complete listing of AvailableProviderOperation 1287// values. 1288type AvailableProviderOperationsIterator struct { 1289 i int 1290 page AvailableProviderOperationsPage 1291} 1292 1293// NextWithContext advances to the next value. If there was an error making 1294// the request the iterator does not advance and the error is returned. 1295func (iter *AvailableProviderOperationsIterator) NextWithContext(ctx context.Context) (err error) { 1296 if tracing.IsEnabled() { 1297 ctx = tracing.StartSpan(ctx, fqdn+"/AvailableProviderOperationsIterator.NextWithContext") 1298 defer func() { 1299 sc := -1 1300 if iter.Response().Response.Response != nil { 1301 sc = iter.Response().Response.Response.StatusCode 1302 } 1303 tracing.EndSpan(ctx, sc, err) 1304 }() 1305 } 1306 iter.i++ 1307 if iter.i < len(iter.page.Values()) { 1308 return nil 1309 } 1310 err = iter.page.NextWithContext(ctx) 1311 if err != nil { 1312 iter.i-- 1313 return err 1314 } 1315 iter.i = 0 1316 return nil 1317} 1318 1319// Next advances to the next value. If there was an error making 1320// the request the iterator does not advance and the error is returned. 1321// Deprecated: Use NextWithContext() instead. 1322func (iter *AvailableProviderOperationsIterator) Next() error { 1323 return iter.NextWithContext(context.Background()) 1324} 1325 1326// NotDone returns true if the enumeration should be started or is not yet complete. 1327func (iter AvailableProviderOperationsIterator) NotDone() bool { 1328 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1329} 1330 1331// Response returns the raw server response from the last page request. 1332func (iter AvailableProviderOperationsIterator) Response() AvailableProviderOperations { 1333 return iter.page.Response() 1334} 1335 1336// Value returns the current value or a zero-initialized value if the 1337// iterator has advanced beyond the end of the collection. 1338func (iter AvailableProviderOperationsIterator) Value() AvailableProviderOperation { 1339 if !iter.page.NotDone() { 1340 return AvailableProviderOperation{} 1341 } 1342 return iter.page.Values()[iter.i] 1343} 1344 1345// Creates a new instance of the AvailableProviderOperationsIterator type. 1346func NewAvailableProviderOperationsIterator(page AvailableProviderOperationsPage) AvailableProviderOperationsIterator { 1347 return AvailableProviderOperationsIterator{page: page} 1348} 1349 1350// IsEmpty returns true if the ListResult contains no values. 1351func (apo AvailableProviderOperations) IsEmpty() bool { 1352 return apo.Value == nil || len(*apo.Value) == 0 1353} 1354 1355// availableProviderOperationsPreparer prepares a request to retrieve the next set of results. 1356// It returns nil if no more results exist. 1357func (apo AvailableProviderOperations) availableProviderOperationsPreparer(ctx context.Context) (*http.Request, error) { 1358 if apo.NextLink == nil || len(to.String(apo.NextLink)) < 1 { 1359 return nil, nil 1360 } 1361 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1362 autorest.AsJSON(), 1363 autorest.AsGet(), 1364 autorest.WithBaseURL(to.String(apo.NextLink))) 1365} 1366 1367// AvailableProviderOperationsPage contains a page of AvailableProviderOperation values. 1368type AvailableProviderOperationsPage struct { 1369 fn func(context.Context, AvailableProviderOperations) (AvailableProviderOperations, error) 1370 apo AvailableProviderOperations 1371} 1372 1373// NextWithContext advances to the next page of values. If there was an error making 1374// the request the page does not advance and the error is returned. 1375func (page *AvailableProviderOperationsPage) NextWithContext(ctx context.Context) (err error) { 1376 if tracing.IsEnabled() { 1377 ctx = tracing.StartSpan(ctx, fqdn+"/AvailableProviderOperationsPage.NextWithContext") 1378 defer func() { 1379 sc := -1 1380 if page.Response().Response.Response != nil { 1381 sc = page.Response().Response.Response.StatusCode 1382 } 1383 tracing.EndSpan(ctx, sc, err) 1384 }() 1385 } 1386 next, err := page.fn(ctx, page.apo) 1387 if err != nil { 1388 return err 1389 } 1390 page.apo = next 1391 return nil 1392} 1393 1394// Next advances to the next page of values. If there was an error making 1395// the request the page does not advance and the error is returned. 1396// Deprecated: Use NextWithContext() instead. 1397func (page *AvailableProviderOperationsPage) Next() error { 1398 return page.NextWithContext(context.Background()) 1399} 1400 1401// NotDone returns true if the page enumeration should be started or is not yet complete. 1402func (page AvailableProviderOperationsPage) NotDone() bool { 1403 return !page.apo.IsEmpty() 1404} 1405 1406// Response returns the raw server response from the last page request. 1407func (page AvailableProviderOperationsPage) Response() AvailableProviderOperations { 1408 return page.apo 1409} 1410 1411// Values returns the slice of values for the current page or nil if there are no values. 1412func (page AvailableProviderOperationsPage) Values() []AvailableProviderOperation { 1413 if page.apo.IsEmpty() { 1414 return nil 1415 } 1416 return *page.apo.Value 1417} 1418 1419// Creates a new instance of the AvailableProviderOperationsPage type. 1420func NewAvailableProviderOperationsPage(getNextPage func(context.Context, AvailableProviderOperations) (AvailableProviderOperations, error)) AvailableProviderOperationsPage { 1421 return AvailableProviderOperationsPage{fn: getNextPage} 1422} 1423 1424// Backup the backup. 1425type Backup struct { 1426 // BackupProperties - Properties of backup 1427 *BackupProperties `json:"properties,omitempty"` 1428 // ID - READ-ONLY; The identifier. 1429 ID *string `json:"id,omitempty"` 1430 // Name - READ-ONLY; The name. 1431 Name *string `json:"name,omitempty"` 1432 // Type - READ-ONLY; The type. 1433 Type *string `json:"type,omitempty"` 1434} 1435 1436// MarshalJSON is the custom marshaler for Backup. 1437func (b Backup) MarshalJSON() ([]byte, error) { 1438 objectMap := make(map[string]interface{}) 1439 if b.BackupProperties != nil { 1440 objectMap["properties"] = b.BackupProperties 1441 } 1442 return json.Marshal(objectMap) 1443} 1444 1445// UnmarshalJSON is the custom unmarshaler for Backup struct. 1446func (b *Backup) UnmarshalJSON(body []byte) error { 1447 var m map[string]*json.RawMessage 1448 err := json.Unmarshal(body, &m) 1449 if err != nil { 1450 return err 1451 } 1452 for k, v := range m { 1453 switch k { 1454 case "properties": 1455 if v != nil { 1456 var backupProperties BackupProperties 1457 err = json.Unmarshal(*v, &backupProperties) 1458 if err != nil { 1459 return err 1460 } 1461 b.BackupProperties = &backupProperties 1462 } 1463 case "id": 1464 if v != nil { 1465 var ID string 1466 err = json.Unmarshal(*v, &ID) 1467 if err != nil { 1468 return err 1469 } 1470 b.ID = &ID 1471 } 1472 case "name": 1473 if v != nil { 1474 var name string 1475 err = json.Unmarshal(*v, &name) 1476 if err != nil { 1477 return err 1478 } 1479 b.Name = &name 1480 } 1481 case "type": 1482 if v != nil { 1483 var typeVar string 1484 err = json.Unmarshal(*v, &typeVar) 1485 if err != nil { 1486 return err 1487 } 1488 b.Type = &typeVar 1489 } 1490 } 1491 } 1492 1493 return nil 1494} 1495 1496// BackupElement class represents BackupElement 1497type BackupElement struct { 1498 // BackupElementProperties - The Properties of backup element 1499 *BackupElementProperties `json:"properties,omitempty"` 1500 // ID - READ-ONLY; The identifier. 1501 ID *string `json:"id,omitempty"` 1502 // Name - READ-ONLY; The name. 1503 Name *string `json:"name,omitempty"` 1504 // Type - READ-ONLY; The type. 1505 Type *string `json:"type,omitempty"` 1506} 1507 1508// MarshalJSON is the custom marshaler for BackupElement. 1509func (be BackupElement) MarshalJSON() ([]byte, error) { 1510 objectMap := make(map[string]interface{}) 1511 if be.BackupElementProperties != nil { 1512 objectMap["properties"] = be.BackupElementProperties 1513 } 1514 return json.Marshal(objectMap) 1515} 1516 1517// UnmarshalJSON is the custom unmarshaler for BackupElement struct. 1518func (be *BackupElement) UnmarshalJSON(body []byte) error { 1519 var m map[string]*json.RawMessage 1520 err := json.Unmarshal(body, &m) 1521 if err != nil { 1522 return err 1523 } 1524 for k, v := range m { 1525 switch k { 1526 case "properties": 1527 if v != nil { 1528 var backupElementProperties BackupElementProperties 1529 err = json.Unmarshal(*v, &backupElementProperties) 1530 if err != nil { 1531 return err 1532 } 1533 be.BackupElementProperties = &backupElementProperties 1534 } 1535 case "id": 1536 if v != nil { 1537 var ID string 1538 err = json.Unmarshal(*v, &ID) 1539 if err != nil { 1540 return err 1541 } 1542 be.ID = &ID 1543 } 1544 case "name": 1545 if v != nil { 1546 var name string 1547 err = json.Unmarshal(*v, &name) 1548 if err != nil { 1549 return err 1550 } 1551 be.Name = &name 1552 } 1553 case "type": 1554 if v != nil { 1555 var typeVar string 1556 err = json.Unmarshal(*v, &typeVar) 1557 if err != nil { 1558 return err 1559 } 1560 be.Type = &typeVar 1561 } 1562 } 1563 } 1564 1565 return nil 1566} 1567 1568// BackupElementProperties the backup element properties 1569type BackupElementProperties struct { 1570 // SizeInBytes - The size in bytes. 1571 SizeInBytes *int64 `json:"sizeInBytes,omitempty"` 1572 // EndpointName - The name of the endpoint. 1573 EndpointName *string `json:"endpointName,omitempty"` 1574 // DataPolicy - The data policy of backed up endpoint. Possible values include: 'DataPolicyInvalid', 'DataPolicyLocal', 'DataPolicyTiered', 'DataPolicyCloud' 1575 DataPolicy DataPolicy `json:"dataPolicy,omitempty"` 1576} 1577 1578// BackupFilter backup OData filter class 1579type BackupFilter struct { 1580 // InitiatedBy - Gets or sets InitiatedBy. Possible values include: 'Manual', 'Scheduled' 1581 InitiatedBy InitiatedBy `json:"initiatedBy,omitempty"` 1582 // CreatedTime - Gets or sets CreatedTime 1583 CreatedTime *date.Time `json:"createdTime,omitempty"` 1584} 1585 1586// BackupList collection of backups 1587type BackupList struct { 1588 autorest.Response `json:"-"` 1589 // Value - The value. 1590 Value *[]Backup `json:"value,omitempty"` 1591 // NextLink - The NextLink. 1592 NextLink *string `json:"nextLink,omitempty"` 1593} 1594 1595// BackupListIterator provides access to a complete listing of Backup values. 1596type BackupListIterator struct { 1597 i int 1598 page BackupListPage 1599} 1600 1601// NextWithContext advances to the next value. If there was an error making 1602// the request the iterator does not advance and the error is returned. 1603func (iter *BackupListIterator) NextWithContext(ctx context.Context) (err error) { 1604 if tracing.IsEnabled() { 1605 ctx = tracing.StartSpan(ctx, fqdn+"/BackupListIterator.NextWithContext") 1606 defer func() { 1607 sc := -1 1608 if iter.Response().Response.Response != nil { 1609 sc = iter.Response().Response.Response.StatusCode 1610 } 1611 tracing.EndSpan(ctx, sc, err) 1612 }() 1613 } 1614 iter.i++ 1615 if iter.i < len(iter.page.Values()) { 1616 return nil 1617 } 1618 err = iter.page.NextWithContext(ctx) 1619 if err != nil { 1620 iter.i-- 1621 return err 1622 } 1623 iter.i = 0 1624 return nil 1625} 1626 1627// Next advances to the next value. If there was an error making 1628// the request the iterator does not advance and the error is returned. 1629// Deprecated: Use NextWithContext() instead. 1630func (iter *BackupListIterator) Next() error { 1631 return iter.NextWithContext(context.Background()) 1632} 1633 1634// NotDone returns true if the enumeration should be started or is not yet complete. 1635func (iter BackupListIterator) NotDone() bool { 1636 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1637} 1638 1639// Response returns the raw server response from the last page request. 1640func (iter BackupListIterator) Response() BackupList { 1641 return iter.page.Response() 1642} 1643 1644// Value returns the current value or a zero-initialized value if the 1645// iterator has advanced beyond the end of the collection. 1646func (iter BackupListIterator) Value() Backup { 1647 if !iter.page.NotDone() { 1648 return Backup{} 1649 } 1650 return iter.page.Values()[iter.i] 1651} 1652 1653// Creates a new instance of the BackupListIterator type. 1654func NewBackupListIterator(page BackupListPage) BackupListIterator { 1655 return BackupListIterator{page: page} 1656} 1657 1658// IsEmpty returns true if the ListResult contains no values. 1659func (bl BackupList) IsEmpty() bool { 1660 return bl.Value == nil || len(*bl.Value) == 0 1661} 1662 1663// backupListPreparer prepares a request to retrieve the next set of results. 1664// It returns nil if no more results exist. 1665func (bl BackupList) backupListPreparer(ctx context.Context) (*http.Request, error) { 1666 if bl.NextLink == nil || len(to.String(bl.NextLink)) < 1 { 1667 return nil, nil 1668 } 1669 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1670 autorest.AsJSON(), 1671 autorest.AsGet(), 1672 autorest.WithBaseURL(to.String(bl.NextLink))) 1673} 1674 1675// BackupListPage contains a page of Backup values. 1676type BackupListPage struct { 1677 fn func(context.Context, BackupList) (BackupList, error) 1678 bl BackupList 1679} 1680 1681// NextWithContext advances to the next page of values. If there was an error making 1682// the request the page does not advance and the error is returned. 1683func (page *BackupListPage) NextWithContext(ctx context.Context) (err error) { 1684 if tracing.IsEnabled() { 1685 ctx = tracing.StartSpan(ctx, fqdn+"/BackupListPage.NextWithContext") 1686 defer func() { 1687 sc := -1 1688 if page.Response().Response.Response != nil { 1689 sc = page.Response().Response.Response.StatusCode 1690 } 1691 tracing.EndSpan(ctx, sc, err) 1692 }() 1693 } 1694 next, err := page.fn(ctx, page.bl) 1695 if err != nil { 1696 return err 1697 } 1698 page.bl = next 1699 return nil 1700} 1701 1702// Next advances to the next page of values. If there was an error making 1703// the request the page does not advance and the error is returned. 1704// Deprecated: Use NextWithContext() instead. 1705func (page *BackupListPage) Next() error { 1706 return page.NextWithContext(context.Background()) 1707} 1708 1709// NotDone returns true if the page enumeration should be started or is not yet complete. 1710func (page BackupListPage) NotDone() bool { 1711 return !page.bl.IsEmpty() 1712} 1713 1714// Response returns the raw server response from the last page request. 1715func (page BackupListPage) Response() BackupList { 1716 return page.bl 1717} 1718 1719// Values returns the slice of values for the current page or nil if there are no values. 1720func (page BackupListPage) Values() []Backup { 1721 if page.bl.IsEmpty() { 1722 return nil 1723 } 1724 return *page.bl.Value 1725} 1726 1727// Creates a new instance of the BackupListPage type. 1728func NewBackupListPage(getNextPage func(context.Context, BackupList) (BackupList, error)) BackupListPage { 1729 return BackupListPage{fn: getNextPage} 1730} 1731 1732// BackupProperties class represents Backup properties 1733type BackupProperties struct { 1734 // TargetID - The path id of the target FileServer or IscsiServer for which the backup was taken. 1735 TargetID *string `json:"targetId,omitempty"` 1736 // TargetType - Type of target, FileServer or IscsiServer 1737 TargetType *string `json:"targetType,omitempty"` 1738 // SizeInBytes - The backup size in bytes. 1739 SizeInBytes *int64 `json:"sizeInBytes,omitempty"` 1740 // CreatedTime - The time when the backup was created. 1741 CreatedTime *date.Time `json:"createdTime,omitempty"` 1742 // ExpirationTime - The time when the backup will expire. 1743 ExpirationTime *date.Time `json:"expirationTime,omitempty"` 1744 // InitiatedBy - Indicates how the backup was initiated "Manual | Scheduled". Possible values include: 'Manual', 'Scheduled' 1745 InitiatedBy InitiatedBy `json:"initiatedBy,omitempty"` 1746 // DeviceID - The Device Identifier. 1747 DeviceID *string `json:"deviceId,omitempty"` 1748 // Elements - The backup elements. 1749 Elements *[]BackupElement `json:"elements,omitempty"` 1750} 1751 1752// BackupScheduleGroup the Backup Schedule Group 1753type BackupScheduleGroup struct { 1754 autorest.Response `json:"-"` 1755 // BackupScheduleGroupProperties - Properties of BackupScheduleGroup 1756 *BackupScheduleGroupProperties `json:"properties,omitempty"` 1757 // ID - READ-ONLY; The identifier. 1758 ID *string `json:"id,omitempty"` 1759 // Name - READ-ONLY; The name. 1760 Name *string `json:"name,omitempty"` 1761 // Type - READ-ONLY; The type. 1762 Type *string `json:"type,omitempty"` 1763} 1764 1765// MarshalJSON is the custom marshaler for BackupScheduleGroup. 1766func (bsg BackupScheduleGroup) MarshalJSON() ([]byte, error) { 1767 objectMap := make(map[string]interface{}) 1768 if bsg.BackupScheduleGroupProperties != nil { 1769 objectMap["properties"] = bsg.BackupScheduleGroupProperties 1770 } 1771 return json.Marshal(objectMap) 1772} 1773 1774// UnmarshalJSON is the custom unmarshaler for BackupScheduleGroup struct. 1775func (bsg *BackupScheduleGroup) UnmarshalJSON(body []byte) error { 1776 var m map[string]*json.RawMessage 1777 err := json.Unmarshal(body, &m) 1778 if err != nil { 1779 return err 1780 } 1781 for k, v := range m { 1782 switch k { 1783 case "properties": 1784 if v != nil { 1785 var backupScheduleGroupProperties BackupScheduleGroupProperties 1786 err = json.Unmarshal(*v, &backupScheduleGroupProperties) 1787 if err != nil { 1788 return err 1789 } 1790 bsg.BackupScheduleGroupProperties = &backupScheduleGroupProperties 1791 } 1792 case "id": 1793 if v != nil { 1794 var ID string 1795 err = json.Unmarshal(*v, &ID) 1796 if err != nil { 1797 return err 1798 } 1799 bsg.ID = &ID 1800 } 1801 case "name": 1802 if v != nil { 1803 var name string 1804 err = json.Unmarshal(*v, &name) 1805 if err != nil { 1806 return err 1807 } 1808 bsg.Name = &name 1809 } 1810 case "type": 1811 if v != nil { 1812 var typeVar string 1813 err = json.Unmarshal(*v, &typeVar) 1814 if err != nil { 1815 return err 1816 } 1817 bsg.Type = &typeVar 1818 } 1819 } 1820 } 1821 1822 return nil 1823} 1824 1825// BackupScheduleGroupList the list response of backup schedule groups 1826type BackupScheduleGroupList struct { 1827 autorest.Response `json:"-"` 1828 // Value - The value. 1829 Value *[]BackupScheduleGroup `json:"value,omitempty"` 1830} 1831 1832// BackupScheduleGroupProperties the Backup Schedule Group Properties 1833type BackupScheduleGroupProperties struct { 1834 // StartTime - The start time. When this field is specified we will generate Default GrandFather Father Son Backup Schedules. 1835 StartTime *Time `json:"startTime,omitempty"` 1836} 1837 1838// BackupScheduleGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 1839// long-running operation. 1840type BackupScheduleGroupsCreateOrUpdateFuture struct { 1841 azure.Future 1842} 1843 1844// Result returns the result of the asynchronous operation. 1845// If the operation has not completed it will return an error. 1846func (future *BackupScheduleGroupsCreateOrUpdateFuture) Result(client BackupScheduleGroupsClient) (bsg BackupScheduleGroup, err error) { 1847 var done bool 1848 done, err = future.DoneWithContext(context.Background(), client) 1849 if err != nil { 1850 err = autorest.NewErrorWithError(err, "storsimple.BackupScheduleGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 1851 return 1852 } 1853 if !done { 1854 err = azure.NewAsyncOpIncompleteError("storsimple.BackupScheduleGroupsCreateOrUpdateFuture") 1855 return 1856 } 1857 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1858 if bsg.Response.Response, err = future.GetResult(sender); err == nil && bsg.Response.Response.StatusCode != http.StatusNoContent { 1859 bsg, err = client.CreateOrUpdateResponder(bsg.Response.Response) 1860 if err != nil { 1861 err = autorest.NewErrorWithError(err, "storsimple.BackupScheduleGroupsCreateOrUpdateFuture", "Result", bsg.Response.Response, "Failure responding to request") 1862 } 1863 } 1864 return 1865} 1866 1867// BackupScheduleGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a 1868// long-running operation. 1869type BackupScheduleGroupsDeleteFuture struct { 1870 azure.Future 1871} 1872 1873// Result returns the result of the asynchronous operation. 1874// If the operation has not completed it will return an error. 1875func (future *BackupScheduleGroupsDeleteFuture) Result(client BackupScheduleGroupsClient) (ar autorest.Response, err error) { 1876 var done bool 1877 done, err = future.DoneWithContext(context.Background(), client) 1878 if err != nil { 1879 err = autorest.NewErrorWithError(err, "storsimple.BackupScheduleGroupsDeleteFuture", "Result", future.Response(), "Polling failure") 1880 return 1881 } 1882 if !done { 1883 err = azure.NewAsyncOpIncompleteError("storsimple.BackupScheduleGroupsDeleteFuture") 1884 return 1885 } 1886 ar.Response = future.Response() 1887 return 1888} 1889 1890// BackupsCloneFuture an abstraction for monitoring and retrieving the results of a long-running operation. 1891type BackupsCloneFuture struct { 1892 azure.Future 1893} 1894 1895// Result returns the result of the asynchronous operation. 1896// If the operation has not completed it will return an error. 1897func (future *BackupsCloneFuture) Result(client BackupsClient) (ar autorest.Response, err error) { 1898 var done bool 1899 done, err = future.DoneWithContext(context.Background(), client) 1900 if err != nil { 1901 err = autorest.NewErrorWithError(err, "storsimple.BackupsCloneFuture", "Result", future.Response(), "Polling failure") 1902 return 1903 } 1904 if !done { 1905 err = azure.NewAsyncOpIncompleteError("storsimple.BackupsCloneFuture") 1906 return 1907 } 1908 ar.Response = future.Response() 1909 return 1910} 1911 1912// BackupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 1913// operation. 1914type BackupsDeleteFuture struct { 1915 azure.Future 1916} 1917 1918// Result returns the result of the asynchronous operation. 1919// If the operation has not completed it will return an error. 1920func (future *BackupsDeleteFuture) Result(client BackupsClient) (ar autorest.Response, err error) { 1921 var done bool 1922 done, err = future.DoneWithContext(context.Background(), client) 1923 if err != nil { 1924 err = autorest.NewErrorWithError(err, "storsimple.BackupsDeleteFuture", "Result", future.Response(), "Polling failure") 1925 return 1926 } 1927 if !done { 1928 err = azure.NewAsyncOpIncompleteError("storsimple.BackupsDeleteFuture") 1929 return 1930 } 1931 ar.Response = future.Response() 1932 return 1933} 1934 1935// BaseModel base class for models 1936type BaseModel struct { 1937 // ID - READ-ONLY; The identifier. 1938 ID *string `json:"id,omitempty"` 1939 // Name - READ-ONLY; The name. 1940 Name *string `json:"name,omitempty"` 1941 // Type - READ-ONLY; The type. 1942 Type *string `json:"type,omitempty"` 1943} 1944 1945// ChapProperties chap properties 1946type ChapProperties struct { 1947 // Password - The chap password. 1948 Password *AsymmetricEncryptedSecret `json:"password,omitempty"` 1949} 1950 1951// ChapSettings challenge-Handshake Authentication Protocol (CHAP) setting 1952type ChapSettings struct { 1953 autorest.Response `json:"-"` 1954 // ChapProperties - Chap properties 1955 *ChapProperties `json:"properties,omitempty"` 1956 // ID - READ-ONLY; The identifier. 1957 ID *string `json:"id,omitempty"` 1958 // Name - READ-ONLY; The name. 1959 Name *string `json:"name,omitempty"` 1960 // Type - READ-ONLY; The type. 1961 Type *string `json:"type,omitempty"` 1962} 1963 1964// MarshalJSON is the custom marshaler for ChapSettings. 1965func (cs ChapSettings) MarshalJSON() ([]byte, error) { 1966 objectMap := make(map[string]interface{}) 1967 if cs.ChapProperties != nil { 1968 objectMap["properties"] = cs.ChapProperties 1969 } 1970 return json.Marshal(objectMap) 1971} 1972 1973// UnmarshalJSON is the custom unmarshaler for ChapSettings struct. 1974func (cs *ChapSettings) UnmarshalJSON(body []byte) error { 1975 var m map[string]*json.RawMessage 1976 err := json.Unmarshal(body, &m) 1977 if err != nil { 1978 return err 1979 } 1980 for k, v := range m { 1981 switch k { 1982 case "properties": 1983 if v != nil { 1984 var chapProperties ChapProperties 1985 err = json.Unmarshal(*v, &chapProperties) 1986 if err != nil { 1987 return err 1988 } 1989 cs.ChapProperties = &chapProperties 1990 } 1991 case "id": 1992 if v != nil { 1993 var ID string 1994 err = json.Unmarshal(*v, &ID) 1995 if err != nil { 1996 return err 1997 } 1998 cs.ID = &ID 1999 } 2000 case "name": 2001 if v != nil { 2002 var name string 2003 err = json.Unmarshal(*v, &name) 2004 if err != nil { 2005 return err 2006 } 2007 cs.Name = &name 2008 } 2009 case "type": 2010 if v != nil { 2011 var typeVar string 2012 err = json.Unmarshal(*v, &typeVar) 2013 if err != nil { 2014 return err 2015 } 2016 cs.Type = &typeVar 2017 } 2018 } 2019 } 2020 2021 return nil 2022} 2023 2024// ChapSettingsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 2025// long-running operation. 2026type ChapSettingsCreateOrUpdateFuture struct { 2027 azure.Future 2028} 2029 2030// Result returns the result of the asynchronous operation. 2031// If the operation has not completed it will return an error. 2032func (future *ChapSettingsCreateOrUpdateFuture) Result(client ChapSettingsClient) (cs ChapSettings, err error) { 2033 var done bool 2034 done, err = future.DoneWithContext(context.Background(), client) 2035 if err != nil { 2036 err = autorest.NewErrorWithError(err, "storsimple.ChapSettingsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 2037 return 2038 } 2039 if !done { 2040 err = azure.NewAsyncOpIncompleteError("storsimple.ChapSettingsCreateOrUpdateFuture") 2041 return 2042 } 2043 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2044 if cs.Response.Response, err = future.GetResult(sender); err == nil && cs.Response.Response.StatusCode != http.StatusNoContent { 2045 cs, err = client.CreateOrUpdateResponder(cs.Response.Response) 2046 if err != nil { 2047 err = autorest.NewErrorWithError(err, "storsimple.ChapSettingsCreateOrUpdateFuture", "Result", cs.Response.Response, "Failure responding to request") 2048 } 2049 } 2050 return 2051} 2052 2053// ChapSettingsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 2054// operation. 2055type ChapSettingsDeleteFuture struct { 2056 azure.Future 2057} 2058 2059// Result returns the result of the asynchronous operation. 2060// If the operation has not completed it will return an error. 2061func (future *ChapSettingsDeleteFuture) Result(client ChapSettingsClient) (ar autorest.Response, err error) { 2062 var done bool 2063 done, err = future.DoneWithContext(context.Background(), client) 2064 if err != nil { 2065 err = autorest.NewErrorWithError(err, "storsimple.ChapSettingsDeleteFuture", "Result", future.Response(), "Polling failure") 2066 return 2067 } 2068 if !done { 2069 err = azure.NewAsyncOpIncompleteError("storsimple.ChapSettingsDeleteFuture") 2070 return 2071 } 2072 ar.Response = future.Response() 2073 return 2074} 2075 2076// ChapSettingsList collection of Chap setting entities 2077type ChapSettingsList struct { 2078 autorest.Response `json:"-"` 2079 // Value - The chap settings entity collection 2080 Value *[]ChapSettings `json:"value,omitempty"` 2081} 2082 2083// ClearAlertRequest request for clearing the alert 2084type ClearAlertRequest struct { 2085 // ResolutionMessage - Resolution message while clearing the request 2086 ResolutionMessage *string `json:"resolutionMessage,omitempty"` 2087 // Alerts - List of alert Ids to be cleared 2088 Alerts *[]string `json:"alerts,omitempty"` 2089} 2090 2091// CloneRequest clone Job Request Model. 2092type CloneRequest struct { 2093 // CloneRequestProperties - CloneJob Properties are encapsulated in this object. 2094 *CloneRequestProperties `json:"properties,omitempty"` 2095} 2096 2097// MarshalJSON is the custom marshaler for CloneRequest. 2098func (cr CloneRequest) MarshalJSON() ([]byte, error) { 2099 objectMap := make(map[string]interface{}) 2100 if cr.CloneRequestProperties != nil { 2101 objectMap["properties"] = cr.CloneRequestProperties 2102 } 2103 return json.Marshal(objectMap) 2104} 2105 2106// UnmarshalJSON is the custom unmarshaler for CloneRequest struct. 2107func (cr *CloneRequest) UnmarshalJSON(body []byte) error { 2108 var m map[string]*json.RawMessage 2109 err := json.Unmarshal(body, &m) 2110 if err != nil { 2111 return err 2112 } 2113 for k, v := range m { 2114 switch k { 2115 case "properties": 2116 if v != nil { 2117 var cloneRequestProperties CloneRequestProperties 2118 err = json.Unmarshal(*v, &cloneRequestProperties) 2119 if err != nil { 2120 return err 2121 } 2122 cr.CloneRequestProperties = &cloneRequestProperties 2123 } 2124 } 2125 } 2126 2127 return nil 2128} 2129 2130// CloneRequestProperties properties of CloneRequest 2131type CloneRequestProperties struct { 2132 // TargetDeviceID - DeviceId of the device which will act as the Clone target 2133 TargetDeviceID *string `json:"targetDeviceId,omitempty"` 2134 // TargetAccessPointID - Access point Id on which clone job will performed. 2135 TargetAccessPointID *string `json:"targetAccessPointId,omitempty"` 2136 // NewEndpointName - Name of new endpoint which will created as part of clone job. 2137 NewEndpointName *string `json:"newEndpointName,omitempty"` 2138 // Share - Share Object. 2139 Share *FileShare `json:"share,omitempty"` 2140 // Disk - Disk Object 2141 Disk *ISCSIDisk `json:"disk,omitempty"` 2142} 2143 2144// Device represents a StorSimple device object along with its properties 2145type Device struct { 2146 autorest.Response `json:"-"` 2147 // DeviceProperties - Collection of properties for the device 2148 *DeviceProperties `json:"properties,omitempty"` 2149 // ID - READ-ONLY; The identifier. 2150 ID *string `json:"id,omitempty"` 2151 // Name - READ-ONLY; The name. 2152 Name *string `json:"name,omitempty"` 2153 // Type - READ-ONLY; The type. 2154 Type *string `json:"type,omitempty"` 2155} 2156 2157// MarshalJSON is the custom marshaler for Device. 2158func (d Device) MarshalJSON() ([]byte, error) { 2159 objectMap := make(map[string]interface{}) 2160 if d.DeviceProperties != nil { 2161 objectMap["properties"] = d.DeviceProperties 2162 } 2163 return json.Marshal(objectMap) 2164} 2165 2166// UnmarshalJSON is the custom unmarshaler for Device struct. 2167func (d *Device) UnmarshalJSON(body []byte) error { 2168 var m map[string]*json.RawMessage 2169 err := json.Unmarshal(body, &m) 2170 if err != nil { 2171 return err 2172 } 2173 for k, v := range m { 2174 switch k { 2175 case "properties": 2176 if v != nil { 2177 var deviceProperties DeviceProperties 2178 err = json.Unmarshal(*v, &deviceProperties) 2179 if err != nil { 2180 return err 2181 } 2182 d.DeviceProperties = &deviceProperties 2183 } 2184 case "id": 2185 if v != nil { 2186 var ID string 2187 err = json.Unmarshal(*v, &ID) 2188 if err != nil { 2189 return err 2190 } 2191 d.ID = &ID 2192 } 2193 case "name": 2194 if v != nil { 2195 var name string 2196 err = json.Unmarshal(*v, &name) 2197 if err != nil { 2198 return err 2199 } 2200 d.Name = &name 2201 } 2202 case "type": 2203 if v != nil { 2204 var typeVar string 2205 err = json.Unmarshal(*v, &typeVar) 2206 if err != nil { 2207 return err 2208 } 2209 d.Type = &typeVar 2210 } 2211 } 2212 } 2213 2214 return nil 2215} 2216 2217// DeviceDetails class containing more granular details about the device 2218type DeviceDetails struct { 2219 // EndpointCount - Total number of endpoints that are currently on the device ( i.e. number of shares on FileServer or number of volumes on IscsiServer) 2220 EndpointCount *int32 `json:"endpointCount,omitempty"` 2221 // TotalStorageInBytes - Total storage available on the device in bytes. 2222 TotalStorageInBytes *int64 `json:"totalStorageInBytes,omitempty"` 2223 // TotalLocalStorageInBytes - Total local storage capacity in device in bytes. 2224 TotalLocalStorageInBytes *int64 `json:"totalLocalStorageInBytes,omitempty"` 2225 // ProvisionedStorageInBytes - Storage in bytes that has been provisioned on the device including both local and cloud 2226 ProvisionedStorageInBytes *int64 `json:"provisionedStorageInBytes,omitempty"` 2227 // ProvisionedLocalStorageInBytes - Storage in bytes that has been provisioned locally on the device 2228 ProvisionedLocalStorageInBytes *int64 `json:"provisionedLocalStorageInBytes,omitempty"` 2229 // UsingStorageInBytes - Storage that is being currently used in bytes including both local and cloud 2230 UsingStorageInBytes *int64 `json:"usingStorageInBytes,omitempty"` 2231 // UsingLocalStorageInBytes - Local Storage that is being currently used in bytes 2232 UsingLocalStorageInBytes *int64 `json:"usingLocalStorageInBytes,omitempty"` 2233 // TotalBackupSizeInBytes - Total size taken up by backups in bytes 2234 TotalBackupSizeInBytes *int64 `json:"totalBackupSizeInBytes,omitempty"` 2235 // AvailableStorageInBytes - Total pending available storage on the device in bytes 2236 AvailableStorageInBytes *int64 `json:"availableStorageInBytes,omitempty"` 2237 // AvailableLocalStorageInBytes - Local pending storage available on the device in bytes 2238 AvailableLocalStorageInBytes *int64 `json:"availableLocalStorageInBytes,omitempty"` 2239} 2240 2241// DeviceList collection of Devices 2242type DeviceList struct { 2243 autorest.Response `json:"-"` 2244 // Value - The value. 2245 Value *[]Device `json:"value,omitempty"` 2246} 2247 2248// DevicePatch class that represents the Input for the PATCH call on Device. Currently the only patchable 2249// property on device is "DeviceDescription" 2250type DevicePatch struct { 2251 // DeviceDescription - Short description given for the device 2252 DeviceDescription *string `json:"deviceDescription,omitempty"` 2253} 2254 2255// DeviceProperties encases all the properties of the Device 2256type DeviceProperties struct { 2257 // ActivationTime - The UTC time at which the device was activated 2258 ActivationTime *date.Time `json:"activationTime,omitempty"` 2259 // AllowedDeviceOperations - Operations that are allowed on the device based on its current state 2260 AllowedDeviceOperations *[]DeviceOperation `json:"allowedDeviceOperations,omitempty"` 2261 // Culture - Language culture setting on the device. For eg: "en-US" 2262 Culture *string `json:"culture,omitempty"` 2263 // DeviceCapabilities - Device can be configured either as FileServer or IscsiServer 2264 DeviceCapabilities *[]SupportedDeviceCapabilities `json:"deviceCapabilities,omitempty"` 2265 // DeviceDescription - Short description given for the device 2266 DeviceDescription *string `json:"deviceDescription,omitempty"` 2267 // DomainName - Fully qualified name of the domain to which the device is attached 2268 DomainName *string `json:"domainName,omitempty"` 2269 // DeviceSoftwareVersion - Version number of the software running on the device 2270 DeviceSoftwareVersion *string `json:"deviceSoftwareVersion,omitempty"` 2271 // FriendlySoftwareName - Friendly name for the software version 2272 FriendlySoftwareName *string `json:"friendlySoftwareName,omitempty"` 2273 // DeviceConfigurationStatus - "Complete" if the device has been successfully registered as File/IscsiServer and the creation of share/volume is complete, "Pending" if the device is only registered but the creation of share/volume is complete is still pending. Possible values include: 'Complete', 'Pending' 2274 DeviceConfigurationStatus DeviceConfigurationStatus `json:"deviceConfigurationStatus,omitempty"` 2275 // ModelDescription - Name of the device model 2276 ModelDescription *string `json:"modelDescription,omitempty"` 2277 // Status - Current status of the device. Possible values include: 'Unknown', 'Online', 'Offline', 'RequiresAttention', 'MaintenanceMode', 'Creating', 'Provisioning', 'Deleted', 'ReadyToSetup', 'Deactivated', 'Deactivating' 2278 Status DeviceStatus `json:"status,omitempty"` 2279 // Type - Type of the device. Possible values include: 'DeviceTypeInvalid', 'DeviceTypeAppliance', 'DeviceTypeVirtualAppliance', 'DeviceTypeSeries9000OnPremVirtualAppliance', 'DeviceTypeSeries9000VirtualAppliance', 'DeviceTypeSeries9000PhysicalAppliance' 2280 Type DeviceType `json:"type,omitempty"` 2281 // Details - subclass containing more storage-related information about the device. This field will be populated only if the get call is made with $expand = details. 2282 Details *DeviceDetails `json:"details,omitempty"` 2283} 2284 2285// DevicesCreateOrUpdateAlertSettingsFuture an abstraction for monitoring and retrieving the results of a 2286// long-running operation. 2287type DevicesCreateOrUpdateAlertSettingsFuture struct { 2288 azure.Future 2289} 2290 2291// Result returns the result of the asynchronous operation. 2292// If the operation has not completed it will return an error. 2293func (future *DevicesCreateOrUpdateAlertSettingsFuture) Result(client DevicesClient) (as AlertSettings, err error) { 2294 var done bool 2295 done, err = future.DoneWithContext(context.Background(), client) 2296 if err != nil { 2297 err = autorest.NewErrorWithError(err, "storsimple.DevicesCreateOrUpdateAlertSettingsFuture", "Result", future.Response(), "Polling failure") 2298 return 2299 } 2300 if !done { 2301 err = azure.NewAsyncOpIncompleteError("storsimple.DevicesCreateOrUpdateAlertSettingsFuture") 2302 return 2303 } 2304 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2305 if as.Response.Response, err = future.GetResult(sender); err == nil && as.Response.Response.StatusCode != http.StatusNoContent { 2306 as, err = client.CreateOrUpdateAlertSettingsResponder(as.Response.Response) 2307 if err != nil { 2308 err = autorest.NewErrorWithError(err, "storsimple.DevicesCreateOrUpdateAlertSettingsFuture", "Result", as.Response.Response, "Failure responding to request") 2309 } 2310 } 2311 return 2312} 2313 2314// DevicesCreateOrUpdateSecuritySettingsFuture an abstraction for monitoring and retrieving the results of 2315// a long-running operation. 2316type DevicesCreateOrUpdateSecuritySettingsFuture struct { 2317 azure.Future 2318} 2319 2320// Result returns the result of the asynchronous operation. 2321// If the operation has not completed it will return an error. 2322func (future *DevicesCreateOrUpdateSecuritySettingsFuture) Result(client DevicesClient) (ar autorest.Response, err error) { 2323 var done bool 2324 done, err = future.DoneWithContext(context.Background(), client) 2325 if err != nil { 2326 err = autorest.NewErrorWithError(err, "storsimple.DevicesCreateOrUpdateSecuritySettingsFuture", "Result", future.Response(), "Polling failure") 2327 return 2328 } 2329 if !done { 2330 err = azure.NewAsyncOpIncompleteError("storsimple.DevicesCreateOrUpdateSecuritySettingsFuture") 2331 return 2332 } 2333 ar.Response = future.Response() 2334 return 2335} 2336 2337// DevicesDeactivateFuture an abstraction for monitoring and retrieving the results of a long-running 2338// operation. 2339type DevicesDeactivateFuture struct { 2340 azure.Future 2341} 2342 2343// Result returns the result of the asynchronous operation. 2344// If the operation has not completed it will return an error. 2345func (future *DevicesDeactivateFuture) Result(client DevicesClient) (ar autorest.Response, err error) { 2346 var done bool 2347 done, err = future.DoneWithContext(context.Background(), client) 2348 if err != nil { 2349 err = autorest.NewErrorWithError(err, "storsimple.DevicesDeactivateFuture", "Result", future.Response(), "Polling failure") 2350 return 2351 } 2352 if !done { 2353 err = azure.NewAsyncOpIncompleteError("storsimple.DevicesDeactivateFuture") 2354 return 2355 } 2356 ar.Response = future.Response() 2357 return 2358} 2359 2360// DevicesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 2361// operation. 2362type DevicesDeleteFuture struct { 2363 azure.Future 2364} 2365 2366// Result returns the result of the asynchronous operation. 2367// If the operation has not completed it will return an error. 2368func (future *DevicesDeleteFuture) Result(client DevicesClient) (ar autorest.Response, err error) { 2369 var done bool 2370 done, err = future.DoneWithContext(context.Background(), client) 2371 if err != nil { 2372 err = autorest.NewErrorWithError(err, "storsimple.DevicesDeleteFuture", "Result", future.Response(), "Polling failure") 2373 return 2374 } 2375 if !done { 2376 err = azure.NewAsyncOpIncompleteError("storsimple.DevicesDeleteFuture") 2377 return 2378 } 2379 ar.Response = future.Response() 2380 return 2381} 2382 2383// DevicesDownloadUpdatesFuture an abstraction for monitoring and retrieving the results of a long-running 2384// operation. 2385type DevicesDownloadUpdatesFuture struct { 2386 azure.Future 2387} 2388 2389// Result returns the result of the asynchronous operation. 2390// If the operation has not completed it will return an error. 2391func (future *DevicesDownloadUpdatesFuture) Result(client DevicesClient) (ar autorest.Response, err error) { 2392 var done bool 2393 done, err = future.DoneWithContext(context.Background(), client) 2394 if err != nil { 2395 err = autorest.NewErrorWithError(err, "storsimple.DevicesDownloadUpdatesFuture", "Result", future.Response(), "Polling failure") 2396 return 2397 } 2398 if !done { 2399 err = azure.NewAsyncOpIncompleteError("storsimple.DevicesDownloadUpdatesFuture") 2400 return 2401 } 2402 ar.Response = future.Response() 2403 return 2404} 2405 2406// DevicesFailoverFuture an abstraction for monitoring and retrieving the results of a long-running 2407// operation. 2408type DevicesFailoverFuture struct { 2409 azure.Future 2410} 2411 2412// Result returns the result of the asynchronous operation. 2413// If the operation has not completed it will return an error. 2414func (future *DevicesFailoverFuture) Result(client DevicesClient) (ar autorest.Response, err error) { 2415 var done bool 2416 done, err = future.DoneWithContext(context.Background(), client) 2417 if err != nil { 2418 err = autorest.NewErrorWithError(err, "storsimple.DevicesFailoverFuture", "Result", future.Response(), "Polling failure") 2419 return 2420 } 2421 if !done { 2422 err = azure.NewAsyncOpIncompleteError("storsimple.DevicesFailoverFuture") 2423 return 2424 } 2425 ar.Response = future.Response() 2426 return 2427} 2428 2429// DevicesInstallUpdatesFuture an abstraction for monitoring and retrieving the results of a long-running 2430// operation. 2431type DevicesInstallUpdatesFuture struct { 2432 azure.Future 2433} 2434 2435// Result returns the result of the asynchronous operation. 2436// If the operation has not completed it will return an error. 2437func (future *DevicesInstallUpdatesFuture) Result(client DevicesClient) (ar autorest.Response, err error) { 2438 var done bool 2439 done, err = future.DoneWithContext(context.Background(), client) 2440 if err != nil { 2441 err = autorest.NewErrorWithError(err, "storsimple.DevicesInstallUpdatesFuture", "Result", future.Response(), "Polling failure") 2442 return 2443 } 2444 if !done { 2445 err = azure.NewAsyncOpIncompleteError("storsimple.DevicesInstallUpdatesFuture") 2446 return 2447 } 2448 ar.Response = future.Response() 2449 return 2450} 2451 2452// DevicesPatchFuture an abstraction for monitoring and retrieving the results of a long-running operation. 2453type DevicesPatchFuture struct { 2454 azure.Future 2455} 2456 2457// Result returns the result of the asynchronous operation. 2458// If the operation has not completed it will return an error. 2459func (future *DevicesPatchFuture) Result(client DevicesClient) (d Device, err error) { 2460 var done bool 2461 done, err = future.DoneWithContext(context.Background(), client) 2462 if err != nil { 2463 err = autorest.NewErrorWithError(err, "storsimple.DevicesPatchFuture", "Result", future.Response(), "Polling failure") 2464 return 2465 } 2466 if !done { 2467 err = azure.NewAsyncOpIncompleteError("storsimple.DevicesPatchFuture") 2468 return 2469 } 2470 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2471 if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent { 2472 d, err = client.PatchResponder(d.Response.Response) 2473 if err != nil { 2474 err = autorest.NewErrorWithError(err, "storsimple.DevicesPatchFuture", "Result", d.Response.Response, "Failure responding to request") 2475 } 2476 } 2477 return 2478} 2479 2480// DevicesScanForUpdatesFuture an abstraction for monitoring and retrieving the results of a long-running 2481// operation. 2482type DevicesScanForUpdatesFuture struct { 2483 azure.Future 2484} 2485 2486// Result returns the result of the asynchronous operation. 2487// If the operation has not completed it will return an error. 2488func (future *DevicesScanForUpdatesFuture) Result(client DevicesClient) (ar autorest.Response, err error) { 2489 var done bool 2490 done, err = future.DoneWithContext(context.Background(), client) 2491 if err != nil { 2492 err = autorest.NewErrorWithError(err, "storsimple.DevicesScanForUpdatesFuture", "Result", future.Response(), "Polling failure") 2493 return 2494 } 2495 if !done { 2496 err = azure.NewAsyncOpIncompleteError("storsimple.DevicesScanForUpdatesFuture") 2497 return 2498 } 2499 ar.Response = future.Response() 2500 return 2501} 2502 2503// EncryptionSettings the EncryptionSettings 2504type EncryptionSettings struct { 2505 autorest.Response `json:"-"` 2506 // EncryptionSettingsProperties - Properties of the EncryptionSettings. 2507 *EncryptionSettingsProperties `json:"properties,omitempty"` 2508 // ID - READ-ONLY; The identifier. 2509 ID *string `json:"id,omitempty"` 2510 // Name - READ-ONLY; The name. 2511 Name *string `json:"name,omitempty"` 2512 // Type - READ-ONLY; The type. 2513 Type *string `json:"type,omitempty"` 2514} 2515 2516// MarshalJSON is the custom marshaler for EncryptionSettings. 2517func (es EncryptionSettings) MarshalJSON() ([]byte, error) { 2518 objectMap := make(map[string]interface{}) 2519 if es.EncryptionSettingsProperties != nil { 2520 objectMap["properties"] = es.EncryptionSettingsProperties 2521 } 2522 return json.Marshal(objectMap) 2523} 2524 2525// UnmarshalJSON is the custom unmarshaler for EncryptionSettings struct. 2526func (es *EncryptionSettings) UnmarshalJSON(body []byte) error { 2527 var m map[string]*json.RawMessage 2528 err := json.Unmarshal(body, &m) 2529 if err != nil { 2530 return err 2531 } 2532 for k, v := range m { 2533 switch k { 2534 case "properties": 2535 if v != nil { 2536 var encryptionSettingsProperties EncryptionSettingsProperties 2537 err = json.Unmarshal(*v, &encryptionSettingsProperties) 2538 if err != nil { 2539 return err 2540 } 2541 es.EncryptionSettingsProperties = &encryptionSettingsProperties 2542 } 2543 case "id": 2544 if v != nil { 2545 var ID string 2546 err = json.Unmarshal(*v, &ID) 2547 if err != nil { 2548 return err 2549 } 2550 es.ID = &ID 2551 } 2552 case "name": 2553 if v != nil { 2554 var name string 2555 err = json.Unmarshal(*v, &name) 2556 if err != nil { 2557 return err 2558 } 2559 es.Name = &name 2560 } 2561 case "type": 2562 if v != nil { 2563 var typeVar string 2564 err = json.Unmarshal(*v, &typeVar) 2565 if err != nil { 2566 return err 2567 } 2568 es.Type = &typeVar 2569 } 2570 } 2571 } 2572 2573 return nil 2574} 2575 2576// EncryptionSettingsProperties the properties of EncryptionSettings 2577type EncryptionSettingsProperties struct { 2578 // EncryptionStatus - The encryption status which indicates if encryption is enabled or not. Possible values include: 'EncryptionStatusEnabled', 'EncryptionStatusDisabled' 2579 EncryptionStatus EncryptionStatus `json:"encryptionStatus,omitempty"` 2580 // KeyRolloverStatus - The key rollover status which indicates if key rollover is required or not. If secrets encryption has been upgraded, then it requires key rollover. Possible values include: 'Required', 'NotRequired' 2581 KeyRolloverStatus KeyRolloverStatus `json:"keyRolloverStatus,omitempty"` 2582} 2583 2584// Error ... 2585type Error struct { 2586 ErrorCode *string `json:"errorCode,omitempty"` 2587 Message *Message `json:"message,omitempty"` 2588 Values *[]Item `json:"values,omitempty"` 2589} 2590 2591// FailoverRequest the Failover request object. 2592type FailoverRequest struct { 2593 AccesspointIds *[]string `json:"accesspointIds,omitempty"` 2594 TargetDeviceID *string `json:"targetDeviceId,omitempty"` 2595 SkipValidation *bool `json:"skipValidation,omitempty"` 2596 KeepSourceDevice *bool `json:"keepSourceDevice,omitempty"` 2597} 2598 2599// FileServer the file server. 2600type FileServer struct { 2601 autorest.Response `json:"-"` 2602 // FileServerProperties - The properties. 2603 *FileServerProperties `json:"properties,omitempty"` 2604 // ID - READ-ONLY; The identifier. 2605 ID *string `json:"id,omitempty"` 2606 // Name - READ-ONLY; The name. 2607 Name *string `json:"name,omitempty"` 2608 // Type - READ-ONLY; The type. 2609 Type *string `json:"type,omitempty"` 2610} 2611 2612// MarshalJSON is the custom marshaler for FileServer. 2613func (fs FileServer) MarshalJSON() ([]byte, error) { 2614 objectMap := make(map[string]interface{}) 2615 if fs.FileServerProperties != nil { 2616 objectMap["properties"] = fs.FileServerProperties 2617 } 2618 return json.Marshal(objectMap) 2619} 2620 2621// UnmarshalJSON is the custom unmarshaler for FileServer struct. 2622func (fs *FileServer) UnmarshalJSON(body []byte) error { 2623 var m map[string]*json.RawMessage 2624 err := json.Unmarshal(body, &m) 2625 if err != nil { 2626 return err 2627 } 2628 for k, v := range m { 2629 switch k { 2630 case "properties": 2631 if v != nil { 2632 var fileServerProperties FileServerProperties 2633 err = json.Unmarshal(*v, &fileServerProperties) 2634 if err != nil { 2635 return err 2636 } 2637 fs.FileServerProperties = &fileServerProperties 2638 } 2639 case "id": 2640 if v != nil { 2641 var ID string 2642 err = json.Unmarshal(*v, &ID) 2643 if err != nil { 2644 return err 2645 } 2646 fs.ID = &ID 2647 } 2648 case "name": 2649 if v != nil { 2650 var name string 2651 err = json.Unmarshal(*v, &name) 2652 if err != nil { 2653 return err 2654 } 2655 fs.Name = &name 2656 } 2657 case "type": 2658 if v != nil { 2659 var typeVar string 2660 err = json.Unmarshal(*v, &typeVar) 2661 if err != nil { 2662 return err 2663 } 2664 fs.Type = &typeVar 2665 } 2666 } 2667 } 2668 2669 return nil 2670} 2671 2672// FileServerList collection of file servers 2673type FileServerList struct { 2674 autorest.Response `json:"-"` 2675 // Value - The value. 2676 Value *[]FileServer `json:"value,omitempty"` 2677} 2678 2679// FileServerProperties the file server properties. 2680type FileServerProperties struct { 2681 // DomainName - Domain of the file server 2682 DomainName *string `json:"domainName,omitempty"` 2683 // StorageDomainID - The storage domain id. 2684 StorageDomainID *string `json:"storageDomainId,omitempty"` 2685 // BackupScheduleGroupID - The backup policy id. 2686 BackupScheduleGroupID *string `json:"backupScheduleGroupId,omitempty"` 2687 // Description - The description of the file server 2688 Description *string `json:"description,omitempty"` 2689} 2690 2691// FileServersBackupNowFuture an abstraction for monitoring and retrieving the results of a long-running 2692// operation. 2693type FileServersBackupNowFuture struct { 2694 azure.Future 2695} 2696 2697// Result returns the result of the asynchronous operation. 2698// If the operation has not completed it will return an error. 2699func (future *FileServersBackupNowFuture) Result(client FileServersClient) (ar autorest.Response, err error) { 2700 var done bool 2701 done, err = future.DoneWithContext(context.Background(), client) 2702 if err != nil { 2703 err = autorest.NewErrorWithError(err, "storsimple.FileServersBackupNowFuture", "Result", future.Response(), "Polling failure") 2704 return 2705 } 2706 if !done { 2707 err = azure.NewAsyncOpIncompleteError("storsimple.FileServersBackupNowFuture") 2708 return 2709 } 2710 ar.Response = future.Response() 2711 return 2712} 2713 2714// FileServersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 2715// long-running operation. 2716type FileServersCreateOrUpdateFuture struct { 2717 azure.Future 2718} 2719 2720// Result returns the result of the asynchronous operation. 2721// If the operation has not completed it will return an error. 2722func (future *FileServersCreateOrUpdateFuture) Result(client FileServersClient) (fs FileServer, err error) { 2723 var done bool 2724 done, err = future.DoneWithContext(context.Background(), client) 2725 if err != nil { 2726 err = autorest.NewErrorWithError(err, "storsimple.FileServersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 2727 return 2728 } 2729 if !done { 2730 err = azure.NewAsyncOpIncompleteError("storsimple.FileServersCreateOrUpdateFuture") 2731 return 2732 } 2733 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2734 if fs.Response.Response, err = future.GetResult(sender); err == nil && fs.Response.Response.StatusCode != http.StatusNoContent { 2735 fs, err = client.CreateOrUpdateResponder(fs.Response.Response) 2736 if err != nil { 2737 err = autorest.NewErrorWithError(err, "storsimple.FileServersCreateOrUpdateFuture", "Result", fs.Response.Response, "Failure responding to request") 2738 } 2739 } 2740 return 2741} 2742 2743// FileServersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 2744// operation. 2745type FileServersDeleteFuture struct { 2746 azure.Future 2747} 2748 2749// Result returns the result of the asynchronous operation. 2750// If the operation has not completed it will return an error. 2751func (future *FileServersDeleteFuture) Result(client FileServersClient) (ar autorest.Response, err error) { 2752 var done bool 2753 done, err = future.DoneWithContext(context.Background(), client) 2754 if err != nil { 2755 err = autorest.NewErrorWithError(err, "storsimple.FileServersDeleteFuture", "Result", future.Response(), "Polling failure") 2756 return 2757 } 2758 if !done { 2759 err = azure.NewAsyncOpIncompleteError("storsimple.FileServersDeleteFuture") 2760 return 2761 } 2762 ar.Response = future.Response() 2763 return 2764} 2765 2766// FileShare the File Share. 2767type FileShare struct { 2768 autorest.Response `json:"-"` 2769 // FileShareProperties - The properties. 2770 *FileShareProperties `json:"properties,omitempty"` 2771 // ID - READ-ONLY; The identifier. 2772 ID *string `json:"id,omitempty"` 2773 // Name - READ-ONLY; The name. 2774 Name *string `json:"name,omitempty"` 2775 // Type - READ-ONLY; The type. 2776 Type *string `json:"type,omitempty"` 2777} 2778 2779// MarshalJSON is the custom marshaler for FileShare. 2780func (fs FileShare) MarshalJSON() ([]byte, error) { 2781 objectMap := make(map[string]interface{}) 2782 if fs.FileShareProperties != nil { 2783 objectMap["properties"] = fs.FileShareProperties 2784 } 2785 return json.Marshal(objectMap) 2786} 2787 2788// UnmarshalJSON is the custom unmarshaler for FileShare struct. 2789func (fs *FileShare) UnmarshalJSON(body []byte) error { 2790 var m map[string]*json.RawMessage 2791 err := json.Unmarshal(body, &m) 2792 if err != nil { 2793 return err 2794 } 2795 for k, v := range m { 2796 switch k { 2797 case "properties": 2798 if v != nil { 2799 var fileShareProperties FileShareProperties 2800 err = json.Unmarshal(*v, &fileShareProperties) 2801 if err != nil { 2802 return err 2803 } 2804 fs.FileShareProperties = &fileShareProperties 2805 } 2806 case "id": 2807 if v != nil { 2808 var ID string 2809 err = json.Unmarshal(*v, &ID) 2810 if err != nil { 2811 return err 2812 } 2813 fs.ID = &ID 2814 } 2815 case "name": 2816 if v != nil { 2817 var name string 2818 err = json.Unmarshal(*v, &name) 2819 if err != nil { 2820 return err 2821 } 2822 fs.Name = &name 2823 } 2824 case "type": 2825 if v != nil { 2826 var typeVar string 2827 err = json.Unmarshal(*v, &typeVar) 2828 if err != nil { 2829 return err 2830 } 2831 fs.Type = &typeVar 2832 } 2833 } 2834 } 2835 2836 return nil 2837} 2838 2839// FileShareList collection of file shares 2840type FileShareList struct { 2841 autorest.Response `json:"-"` 2842 // Value - The value. 2843 Value *[]FileShare `json:"value,omitempty"` 2844} 2845 2846// FileShareProperties the File Share. 2847type FileShareProperties struct { 2848 // Description - Description for file share 2849 Description *string `json:"description,omitempty"` 2850 // ShareStatus - The Share Status. Possible values include: 'ShareStatusOnline', 'ShareStatusOffline' 2851 ShareStatus ShareStatus `json:"shareStatus,omitempty"` 2852 // DataPolicy - The data policy. Possible values include: 'DataPolicyInvalid', 'DataPolicyLocal', 'DataPolicyTiered', 'DataPolicyCloud' 2853 DataPolicy DataPolicy `json:"dataPolicy,omitempty"` 2854 // AdminUser - The user/group who will have full permission in this share. Active directory email address. Example: xyz@contoso.com or Contoso\xyz. 2855 AdminUser *string `json:"adminUser,omitempty"` 2856 // ProvisionedCapacityInBytes - The total provisioned capacity in Bytes 2857 ProvisionedCapacityInBytes *int64 `json:"provisionedCapacityInBytes,omitempty"` 2858 // UsedCapacityInBytes - READ-ONLY; The used capacity in Bytes. 2859 UsedCapacityInBytes *int64 `json:"usedCapacityInBytes,omitempty"` 2860 // LocalUsedCapacityInBytes - READ-ONLY; The local used capacity in Bytes. 2861 LocalUsedCapacityInBytes *int64 `json:"localUsedCapacityInBytes,omitempty"` 2862 // MonitoringStatus - The monitoring status. Possible values include: 'MonitoringStatusEnabled', 'MonitoringStatusDisabled' 2863 MonitoringStatus MonitoringStatus `json:"monitoringStatus,omitempty"` 2864} 2865 2866// FileSharesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 2867// long-running operation. 2868type FileSharesCreateOrUpdateFuture struct { 2869 azure.Future 2870} 2871 2872// Result returns the result of the asynchronous operation. 2873// If the operation has not completed it will return an error. 2874func (future *FileSharesCreateOrUpdateFuture) Result(client FileSharesClient) (fs FileShare, err error) { 2875 var done bool 2876 done, err = future.DoneWithContext(context.Background(), client) 2877 if err != nil { 2878 err = autorest.NewErrorWithError(err, "storsimple.FileSharesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 2879 return 2880 } 2881 if !done { 2882 err = azure.NewAsyncOpIncompleteError("storsimple.FileSharesCreateOrUpdateFuture") 2883 return 2884 } 2885 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2886 if fs.Response.Response, err = future.GetResult(sender); err == nil && fs.Response.Response.StatusCode != http.StatusNoContent { 2887 fs, err = client.CreateOrUpdateResponder(fs.Response.Response) 2888 if err != nil { 2889 err = autorest.NewErrorWithError(err, "storsimple.FileSharesCreateOrUpdateFuture", "Result", fs.Response.Response, "Failure responding to request") 2890 } 2891 } 2892 return 2893} 2894 2895// FileSharesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 2896// operation. 2897type FileSharesDeleteFuture struct { 2898 azure.Future 2899} 2900 2901// Result returns the result of the asynchronous operation. 2902// If the operation has not completed it will return an error. 2903func (future *FileSharesDeleteFuture) Result(client FileSharesClient) (ar autorest.Response, err error) { 2904 var done bool 2905 done, err = future.DoneWithContext(context.Background(), client) 2906 if err != nil { 2907 err = autorest.NewErrorWithError(err, "storsimple.FileSharesDeleteFuture", "Result", future.Response(), "Polling failure") 2908 return 2909 } 2910 if !done { 2911 err = azure.NewAsyncOpIncompleteError("storsimple.FileSharesDeleteFuture") 2912 return 2913 } 2914 ar.Response = future.Response() 2915 return 2916} 2917 2918// IPConfig details related to the IP address configuration 2919type IPConfig struct { 2920 // IPAddress - The IP address of the network adapter, either ipv4 or ipv6. 2921 IPAddress *string `json:"ipAddress,omitempty"` 2922 // PrefixLength - The prefix length of the network adapter. 2923 PrefixLength *int32 `json:"prefixLength,omitempty"` 2924 // Gateway - The gateway of the network adapter. 2925 Gateway *string `json:"gateway,omitempty"` 2926} 2927 2928// ISCSIDisk the iSCSI disk. 2929type ISCSIDisk struct { 2930 autorest.Response `json:"-"` 2931 // ISCSIDiskProperties - The properties. 2932 *ISCSIDiskProperties `json:"properties,omitempty"` 2933 // ID - READ-ONLY; The identifier. 2934 ID *string `json:"id,omitempty"` 2935 // Name - READ-ONLY; The name. 2936 Name *string `json:"name,omitempty"` 2937 // Type - READ-ONLY; The type. 2938 Type *string `json:"type,omitempty"` 2939} 2940 2941// MarshalJSON is the custom marshaler for ISCSIDisk. 2942func (ID ISCSIDisk) MarshalJSON() ([]byte, error) { 2943 objectMap := make(map[string]interface{}) 2944 if ID.ISCSIDiskProperties != nil { 2945 objectMap["properties"] = ID.ISCSIDiskProperties 2946 } 2947 return json.Marshal(objectMap) 2948} 2949 2950// UnmarshalJSON is the custom unmarshaler for ISCSIDisk struct. 2951func (ID *ISCSIDisk) UnmarshalJSON(body []byte) error { 2952 var m map[string]*json.RawMessage 2953 err := json.Unmarshal(body, &m) 2954 if err != nil { 2955 return err 2956 } 2957 for k, v := range m { 2958 switch k { 2959 case "properties": 2960 if v != nil { 2961 var iSCSIDiskProperties ISCSIDiskProperties 2962 err = json.Unmarshal(*v, &iSCSIDiskProperties) 2963 if err != nil { 2964 return err 2965 } 2966 ID.ISCSIDiskProperties = &iSCSIDiskProperties 2967 } 2968 case "id": 2969 if v != nil { 2970 var ID1 string 2971 err = json.Unmarshal(*v, &ID1) 2972 if err != nil { 2973 return err 2974 } 2975 ID.ID = &ID1 2976 } 2977 case "name": 2978 if v != nil { 2979 var name string 2980 err = json.Unmarshal(*v, &name) 2981 if err != nil { 2982 return err 2983 } 2984 ID.Name = &name 2985 } 2986 case "type": 2987 if v != nil { 2988 var typeVar string 2989 err = json.Unmarshal(*v, &typeVar) 2990 if err != nil { 2991 return err 2992 } 2993 ID.Type = &typeVar 2994 } 2995 } 2996 } 2997 2998 return nil 2999} 3000 3001// ISCSIDiskList collection of Iscsi disk 3002type ISCSIDiskList struct { 3003 autorest.Response `json:"-"` 3004 // Value - The value. 3005 Value *[]ISCSIDisk `json:"value,omitempty"` 3006} 3007 3008// ISCSIDiskProperties the iSCSI disk properties. 3009type ISCSIDiskProperties struct { 3010 // Description - The description. 3011 Description *string `json:"description,omitempty"` 3012 // DiskStatus - The disk status. Possible values include: 'DiskStatusOnline', 'DiskStatusOffline' 3013 DiskStatus DiskStatus `json:"diskStatus,omitempty"` 3014 // AccessControlRecords - The access control records. 3015 AccessControlRecords *[]string `json:"accessControlRecords,omitempty"` 3016 // DataPolicy - The data policy. Possible values include: 'DataPolicyInvalid', 'DataPolicyLocal', 'DataPolicyTiered', 'DataPolicyCloud' 3017 DataPolicy DataPolicy `json:"dataPolicy,omitempty"` 3018 // ProvisionedCapacityInBytes - The provisioned capacity in bytes. 3019 ProvisionedCapacityInBytes *int64 `json:"provisionedCapacityInBytes,omitempty"` 3020 // UsedCapacityInBytes - READ-ONLY; The used capacity in bytes. 3021 UsedCapacityInBytes *int64 `json:"usedCapacityInBytes,omitempty"` 3022 // LocalUsedCapacityInBytes - READ-ONLY; The local used capacity in bytes. 3023 LocalUsedCapacityInBytes *int64 `json:"localUsedCapacityInBytes,omitempty"` 3024 // MonitoringStatus - The monitoring. Possible values include: 'MonitoringStatusEnabled', 'MonitoringStatusDisabled' 3025 MonitoringStatus MonitoringStatus `json:"monitoringStatus,omitempty"` 3026} 3027 3028// IscsiDisksCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 3029// long-running operation. 3030type IscsiDisksCreateOrUpdateFuture struct { 3031 azure.Future 3032} 3033 3034// Result returns the result of the asynchronous operation. 3035// If the operation has not completed it will return an error. 3036func (future *IscsiDisksCreateOrUpdateFuture) Result(client IscsiDisksClient) (ID ISCSIDisk, err error) { 3037 var done bool 3038 done, err = future.DoneWithContext(context.Background(), client) 3039 if err != nil { 3040 err = autorest.NewErrorWithError(err, "storsimple.IscsiDisksCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 3041 return 3042 } 3043 if !done { 3044 err = azure.NewAsyncOpIncompleteError("storsimple.IscsiDisksCreateOrUpdateFuture") 3045 return 3046 } 3047 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3048 if ID.Response.Response, err = future.GetResult(sender); err == nil && ID.Response.Response.StatusCode != http.StatusNoContent { 3049 ID, err = client.CreateOrUpdateResponder(ID.Response.Response) 3050 if err != nil { 3051 err = autorest.NewErrorWithError(err, "storsimple.IscsiDisksCreateOrUpdateFuture", "Result", ID.Response.Response, "Failure responding to request") 3052 } 3053 } 3054 return 3055} 3056 3057// IscsiDisksDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 3058// operation. 3059type IscsiDisksDeleteFuture struct { 3060 azure.Future 3061} 3062 3063// Result returns the result of the asynchronous operation. 3064// If the operation has not completed it will return an error. 3065func (future *IscsiDisksDeleteFuture) Result(client IscsiDisksClient) (ar autorest.Response, err error) { 3066 var done bool 3067 done, err = future.DoneWithContext(context.Background(), client) 3068 if err != nil { 3069 err = autorest.NewErrorWithError(err, "storsimple.IscsiDisksDeleteFuture", "Result", future.Response(), "Polling failure") 3070 return 3071 } 3072 if !done { 3073 err = azure.NewAsyncOpIncompleteError("storsimple.IscsiDisksDeleteFuture") 3074 return 3075 } 3076 ar.Response = future.Response() 3077 return 3078} 3079 3080// ISCSIServer the iSCSI server. 3081type ISCSIServer struct { 3082 autorest.Response `json:"-"` 3083 // ISCSIServerProperties - The properties. 3084 *ISCSIServerProperties `json:"properties,omitempty"` 3085 // ID - READ-ONLY; The identifier. 3086 ID *string `json:"id,omitempty"` 3087 // Name - READ-ONLY; The name. 3088 Name *string `json:"name,omitempty"` 3089 // Type - READ-ONLY; The type. 3090 Type *string `json:"type,omitempty"` 3091} 3092 3093// MarshalJSON is the custom marshaler for ISCSIServer. 3094func (is ISCSIServer) MarshalJSON() ([]byte, error) { 3095 objectMap := make(map[string]interface{}) 3096 if is.ISCSIServerProperties != nil { 3097 objectMap["properties"] = is.ISCSIServerProperties 3098 } 3099 return json.Marshal(objectMap) 3100} 3101 3102// UnmarshalJSON is the custom unmarshaler for ISCSIServer struct. 3103func (is *ISCSIServer) UnmarshalJSON(body []byte) error { 3104 var m map[string]*json.RawMessage 3105 err := json.Unmarshal(body, &m) 3106 if err != nil { 3107 return err 3108 } 3109 for k, v := range m { 3110 switch k { 3111 case "properties": 3112 if v != nil { 3113 var iSCSIServerProperties ISCSIServerProperties 3114 err = json.Unmarshal(*v, &iSCSIServerProperties) 3115 if err != nil { 3116 return err 3117 } 3118 is.ISCSIServerProperties = &iSCSIServerProperties 3119 } 3120 case "id": 3121 if v != nil { 3122 var ID string 3123 err = json.Unmarshal(*v, &ID) 3124 if err != nil { 3125 return err 3126 } 3127 is.ID = &ID 3128 } 3129 case "name": 3130 if v != nil { 3131 var name string 3132 err = json.Unmarshal(*v, &name) 3133 if err != nil { 3134 return err 3135 } 3136 is.Name = &name 3137 } 3138 case "type": 3139 if v != nil { 3140 var typeVar string 3141 err = json.Unmarshal(*v, &typeVar) 3142 if err != nil { 3143 return err 3144 } 3145 is.Type = &typeVar 3146 } 3147 } 3148 } 3149 3150 return nil 3151} 3152 3153// ISCSIServerList collection of Iscsi servers 3154type ISCSIServerList struct { 3155 autorest.Response `json:"-"` 3156 // Value - The value. 3157 Value *[]ISCSIServer `json:"value,omitempty"` 3158} 3159 3160// ISCSIServerProperties the iSCSI server properties. 3161type ISCSIServerProperties struct { 3162 // StorageDomainID - The storage domain id. 3163 StorageDomainID *string `json:"storageDomainId,omitempty"` 3164 // BackupScheduleGroupID - The backup policy id. 3165 BackupScheduleGroupID *string `json:"backupScheduleGroupId,omitempty"` 3166 // Description - The description. 3167 Description *string `json:"description,omitempty"` 3168 // ChapID - The chap id. 3169 ChapID *string `json:"chapId,omitempty"` 3170 // ReverseChapID - The reverse chap id. 3171 ReverseChapID *string `json:"reverseChapId,omitempty"` 3172} 3173 3174// IscsiServersBackupNowFuture an abstraction for monitoring and retrieving the results of a long-running 3175// operation. 3176type IscsiServersBackupNowFuture struct { 3177 azure.Future 3178} 3179 3180// Result returns the result of the asynchronous operation. 3181// If the operation has not completed it will return an error. 3182func (future *IscsiServersBackupNowFuture) Result(client IscsiServersClient) (ar autorest.Response, err error) { 3183 var done bool 3184 done, err = future.DoneWithContext(context.Background(), client) 3185 if err != nil { 3186 err = autorest.NewErrorWithError(err, "storsimple.IscsiServersBackupNowFuture", "Result", future.Response(), "Polling failure") 3187 return 3188 } 3189 if !done { 3190 err = azure.NewAsyncOpIncompleteError("storsimple.IscsiServersBackupNowFuture") 3191 return 3192 } 3193 ar.Response = future.Response() 3194 return 3195} 3196 3197// IscsiServersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 3198// long-running operation. 3199type IscsiServersCreateOrUpdateFuture struct { 3200 azure.Future 3201} 3202 3203// Result returns the result of the asynchronous operation. 3204// If the operation has not completed it will return an error. 3205func (future *IscsiServersCreateOrUpdateFuture) Result(client IscsiServersClient) (is ISCSIServer, err error) { 3206 var done bool 3207 done, err = future.DoneWithContext(context.Background(), client) 3208 if err != nil { 3209 err = autorest.NewErrorWithError(err, "storsimple.IscsiServersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 3210 return 3211 } 3212 if !done { 3213 err = azure.NewAsyncOpIncompleteError("storsimple.IscsiServersCreateOrUpdateFuture") 3214 return 3215 } 3216 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3217 if is.Response.Response, err = future.GetResult(sender); err == nil && is.Response.Response.StatusCode != http.StatusNoContent { 3218 is, err = client.CreateOrUpdateResponder(is.Response.Response) 3219 if err != nil { 3220 err = autorest.NewErrorWithError(err, "storsimple.IscsiServersCreateOrUpdateFuture", "Result", is.Response.Response, "Failure responding to request") 3221 } 3222 } 3223 return 3224} 3225 3226// IscsiServersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 3227// operation. 3228type IscsiServersDeleteFuture struct { 3229 azure.Future 3230} 3231 3232// Result returns the result of the asynchronous operation. 3233// If the operation has not completed it will return an error. 3234func (future *IscsiServersDeleteFuture) Result(client IscsiServersClient) (ar autorest.Response, err error) { 3235 var done bool 3236 done, err = future.DoneWithContext(context.Background(), client) 3237 if err != nil { 3238 err = autorest.NewErrorWithError(err, "storsimple.IscsiServersDeleteFuture", "Result", future.Response(), "Polling failure") 3239 return 3240 } 3241 if !done { 3242 err = azure.NewAsyncOpIncompleteError("storsimple.IscsiServersDeleteFuture") 3243 return 3244 } 3245 ar.Response = future.Response() 3246 return 3247} 3248 3249// Item ... 3250type Item struct { 3251 Key *string `json:"key,omitempty"` 3252 Value *string `json:"value,omitempty"` 3253} 3254 3255// Job the Job. 3256type Job struct { 3257 autorest.Response `json:"-"` 3258 // Status - Current status of the job. Possible values include: 'JobStatusInvalid', 'JobStatusRunning', 'JobStatusSucceeded', 'JobStatusFailed', 'JobStatusCanceled', 'JobStatusPaused', 'JobStatusScheduled' 3259 Status JobStatus `json:"status,omitempty"` 3260 // StartTime - The UTC time at which the job was started 3261 StartTime *date.Time `json:"startTime,omitempty"` 3262 // EndTime - The UTC time at which the job completed 3263 EndTime *date.Time `json:"endTime,omitempty"` 3264 // PercentComplete - The percentage of the job that is already complete 3265 PercentComplete *int32 `json:"percentComplete,omitempty"` 3266 // Error - The Error details. 3267 Error *JobErrorDetails `json:"error,omitempty"` 3268 // JobProperties - Other properties of the job 3269 *JobProperties `json:"properties,omitempty"` 3270 // ID - READ-ONLY; The identifier. 3271 ID *string `json:"id,omitempty"` 3272 // Name - READ-ONLY; The name. 3273 Name *string `json:"name,omitempty"` 3274 // Type - READ-ONLY; The type. 3275 Type *string `json:"type,omitempty"` 3276} 3277 3278// MarshalJSON is the custom marshaler for Job. 3279func (j Job) MarshalJSON() ([]byte, error) { 3280 objectMap := make(map[string]interface{}) 3281 if j.Status != "" { 3282 objectMap["status"] = j.Status 3283 } 3284 if j.StartTime != nil { 3285 objectMap["startTime"] = j.StartTime 3286 } 3287 if j.EndTime != nil { 3288 objectMap["endTime"] = j.EndTime 3289 } 3290 if j.PercentComplete != nil { 3291 objectMap["percentComplete"] = j.PercentComplete 3292 } 3293 if j.Error != nil { 3294 objectMap["error"] = j.Error 3295 } 3296 if j.JobProperties != nil { 3297 objectMap["properties"] = j.JobProperties 3298 } 3299 return json.Marshal(objectMap) 3300} 3301 3302// UnmarshalJSON is the custom unmarshaler for Job struct. 3303func (j *Job) UnmarshalJSON(body []byte) error { 3304 var m map[string]*json.RawMessage 3305 err := json.Unmarshal(body, &m) 3306 if err != nil { 3307 return err 3308 } 3309 for k, v := range m { 3310 switch k { 3311 case "status": 3312 if v != nil { 3313 var status JobStatus 3314 err = json.Unmarshal(*v, &status) 3315 if err != nil { 3316 return err 3317 } 3318 j.Status = status 3319 } 3320 case "startTime": 3321 if v != nil { 3322 var startTime date.Time 3323 err = json.Unmarshal(*v, &startTime) 3324 if err != nil { 3325 return err 3326 } 3327 j.StartTime = &startTime 3328 } 3329 case "endTime": 3330 if v != nil { 3331 var endTime date.Time 3332 err = json.Unmarshal(*v, &endTime) 3333 if err != nil { 3334 return err 3335 } 3336 j.EndTime = &endTime 3337 } 3338 case "percentComplete": 3339 if v != nil { 3340 var percentComplete int32 3341 err = json.Unmarshal(*v, &percentComplete) 3342 if err != nil { 3343 return err 3344 } 3345 j.PercentComplete = &percentComplete 3346 } 3347 case "error": 3348 if v != nil { 3349 var errorVar JobErrorDetails 3350 err = json.Unmarshal(*v, &errorVar) 3351 if err != nil { 3352 return err 3353 } 3354 j.Error = &errorVar 3355 } 3356 case "properties": 3357 if v != nil { 3358 var jobProperties JobProperties 3359 err = json.Unmarshal(*v, &jobProperties) 3360 if err != nil { 3361 return err 3362 } 3363 j.JobProperties = &jobProperties 3364 } 3365 case "id": 3366 if v != nil { 3367 var ID string 3368 err = json.Unmarshal(*v, &ID) 3369 if err != nil { 3370 return err 3371 } 3372 j.ID = &ID 3373 } 3374 case "name": 3375 if v != nil { 3376 var name string 3377 err = json.Unmarshal(*v, &name) 3378 if err != nil { 3379 return err 3380 } 3381 j.Name = &name 3382 } 3383 case "type": 3384 if v != nil { 3385 var typeVar string 3386 err = json.Unmarshal(*v, &typeVar) 3387 if err != nil { 3388 return err 3389 } 3390 j.Type = &typeVar 3391 } 3392 } 3393 } 3394 3395 return nil 3396} 3397 3398// JobErrorDetails the job error information containing List of JobErrorItem. 3399type JobErrorDetails struct { 3400 // ErrorDetails - The error details. 3401 ErrorDetails *[]JobErrorItem `json:"errorDetails,omitempty"` 3402 // Code - The code intended for programmatic access 3403 Code *string `json:"code,omitempty"` 3404 // Message - The message intended to describe the error in detail 3405 Message *string `json:"message,omitempty"` 3406} 3407 3408// JobErrorItem the job error items. 3409type JobErrorItem struct { 3410 // Recommendations - The recommended actions. 3411 Recommendations *[]string `json:"recommendations,omitempty"` 3412 // Code - The code intended for programmatic access 3413 Code *string `json:"code,omitempty"` 3414 // Message - The message intended to describe the error in detail 3415 Message *string `json:"message,omitempty"` 3416} 3417 3418// JobFilter filters that can be specified for the job 3419type JobFilter struct { 3420 // JobType - The job type. Possible values include: 'JobTypeBackup', 'JobTypeClone', 'JobTypeFailover', 'JobTypeDownloadUpdates', 'JobTypeInstallUpdates' 3421 JobType JobType `json:"jobType,omitempty"` 3422 // Status - The job status. Possible values include: 'JobStatusInvalid', 'JobStatusRunning', 'JobStatusSucceeded', 'JobStatusFailed', 'JobStatusCanceled', 'JobStatusPaused', 'JobStatusScheduled' 3423 Status JobStatus `json:"status,omitempty"` 3424 // StartTime - The start time of the job. 3425 StartTime *date.Time `json:"startTime,omitempty"` 3426} 3427 3428// JobList collection of jobs 3429type JobList struct { 3430 autorest.Response `json:"-"` 3431 // Value - The value. 3432 Value *[]Job `json:"value,omitempty"` 3433 // NextLink - The NextLink. 3434 NextLink *string `json:"nextLink,omitempty"` 3435} 3436 3437// JobListIterator provides access to a complete listing of Job values. 3438type JobListIterator struct { 3439 i int 3440 page JobListPage 3441} 3442 3443// NextWithContext advances to the next value. If there was an error making 3444// the request the iterator does not advance and the error is returned. 3445func (iter *JobListIterator) NextWithContext(ctx context.Context) (err error) { 3446 if tracing.IsEnabled() { 3447 ctx = tracing.StartSpan(ctx, fqdn+"/JobListIterator.NextWithContext") 3448 defer func() { 3449 sc := -1 3450 if iter.Response().Response.Response != nil { 3451 sc = iter.Response().Response.Response.StatusCode 3452 } 3453 tracing.EndSpan(ctx, sc, err) 3454 }() 3455 } 3456 iter.i++ 3457 if iter.i < len(iter.page.Values()) { 3458 return nil 3459 } 3460 err = iter.page.NextWithContext(ctx) 3461 if err != nil { 3462 iter.i-- 3463 return err 3464 } 3465 iter.i = 0 3466 return nil 3467} 3468 3469// Next advances to the next value. If there was an error making 3470// the request the iterator does not advance and the error is returned. 3471// Deprecated: Use NextWithContext() instead. 3472func (iter *JobListIterator) Next() error { 3473 return iter.NextWithContext(context.Background()) 3474} 3475 3476// NotDone returns true if the enumeration should be started or is not yet complete. 3477func (iter JobListIterator) NotDone() bool { 3478 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3479} 3480 3481// Response returns the raw server response from the last page request. 3482func (iter JobListIterator) Response() JobList { 3483 return iter.page.Response() 3484} 3485 3486// Value returns the current value or a zero-initialized value if the 3487// iterator has advanced beyond the end of the collection. 3488func (iter JobListIterator) Value() Job { 3489 if !iter.page.NotDone() { 3490 return Job{} 3491 } 3492 return iter.page.Values()[iter.i] 3493} 3494 3495// Creates a new instance of the JobListIterator type. 3496func NewJobListIterator(page JobListPage) JobListIterator { 3497 return JobListIterator{page: page} 3498} 3499 3500// IsEmpty returns true if the ListResult contains no values. 3501func (jl JobList) IsEmpty() bool { 3502 return jl.Value == nil || len(*jl.Value) == 0 3503} 3504 3505// jobListPreparer prepares a request to retrieve the next set of results. 3506// It returns nil if no more results exist. 3507func (jl JobList) jobListPreparer(ctx context.Context) (*http.Request, error) { 3508 if jl.NextLink == nil || len(to.String(jl.NextLink)) < 1 { 3509 return nil, nil 3510 } 3511 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3512 autorest.AsJSON(), 3513 autorest.AsGet(), 3514 autorest.WithBaseURL(to.String(jl.NextLink))) 3515} 3516 3517// JobListPage contains a page of Job values. 3518type JobListPage struct { 3519 fn func(context.Context, JobList) (JobList, error) 3520 jl JobList 3521} 3522 3523// NextWithContext advances to the next page of values. If there was an error making 3524// the request the page does not advance and the error is returned. 3525func (page *JobListPage) NextWithContext(ctx context.Context) (err error) { 3526 if tracing.IsEnabled() { 3527 ctx = tracing.StartSpan(ctx, fqdn+"/JobListPage.NextWithContext") 3528 defer func() { 3529 sc := -1 3530 if page.Response().Response.Response != nil { 3531 sc = page.Response().Response.Response.StatusCode 3532 } 3533 tracing.EndSpan(ctx, sc, err) 3534 }() 3535 } 3536 next, err := page.fn(ctx, page.jl) 3537 if err != nil { 3538 return err 3539 } 3540 page.jl = next 3541 return nil 3542} 3543 3544// Next advances to the next page of values. If there was an error making 3545// the request the page does not advance and the error is returned. 3546// Deprecated: Use NextWithContext() instead. 3547func (page *JobListPage) Next() error { 3548 return page.NextWithContext(context.Background()) 3549} 3550 3551// NotDone returns true if the page enumeration should be started or is not yet complete. 3552func (page JobListPage) NotDone() bool { 3553 return !page.jl.IsEmpty() 3554} 3555 3556// Response returns the raw server response from the last page request. 3557func (page JobListPage) Response() JobList { 3558 return page.jl 3559} 3560 3561// Values returns the slice of values for the current page or nil if there are no values. 3562func (page JobListPage) Values() []Job { 3563 if page.jl.IsEmpty() { 3564 return nil 3565 } 3566 return *page.jl.Value 3567} 3568 3569// Creates a new instance of the JobListPage type. 3570func NewJobListPage(getNextPage func(context.Context, JobList) (JobList, error)) JobListPage { 3571 return JobListPage{fn: getNextPage} 3572} 3573 3574// JobProperties properties for the job 3575type JobProperties struct { 3576 // JobType - Type of the job. Possible values include: 'JobTypeBackup', 'JobTypeClone', 'JobTypeFailover', 'JobTypeDownloadUpdates', 'JobTypeInstallUpdates' 3577 JobType JobType `json:"jobType,omitempty"` 3578 // TargetID - Id of the object that is created by the job 3579 TargetID *string `json:"targetId,omitempty"` 3580 // EntityID - The entity identifier for which the job ran. 3581 EntityID *string `json:"entityId,omitempty"` 3582 // EntityType - The entity type for which the job ran. 3583 EntityType *string `json:"entityType,omitempty"` 3584 // JobStages - The job stages. 3585 JobStages *[]JobStage `json:"jobStages,omitempty"` 3586 // DeviceID - The device id in which the job is currently running 3587 DeviceID *string `json:"deviceId,omitempty"` 3588 // IsCancellable - Represents whether the job is cancellable or not 3589 IsCancellable *bool `json:"isCancellable,omitempty"` 3590 // Stats - stats properties for the job 3591 Stats *JobStats `json:"stats,omitempty"` 3592 // TargetType - The target type of the backup. Possible values include: 'TargetTypeFileServer', 'TargetTypeDiskServer' 3593 TargetType TargetType `json:"targetType,omitempty"` 3594 // SourceDeviceID - The source device identifier of the failover job. 3595 SourceDeviceID *string `json:"sourceDeviceId,omitempty"` 3596 // BackupPointInTime - The time of the backup used for the failover. 3597 BackupPointInTime *date.Time `json:"backupPointInTime,omitempty"` 3598 // DownloadProgress - The download progress. 3599 DownloadProgress *UpdateDownloadProgress `json:"downloadProgress,omitempty"` 3600 // InstallProgress - The install progress. 3601 InstallProgress *UpdateInstallProgress `json:"installProgress,omitempty"` 3602} 3603 3604// JobStage contains details about the multiple job stages of a job 3605type JobStage struct { 3606 // Message - The message of the job stage. 3607 Message *string `json:"message,omitempty"` 3608 // StageStatus - The stage status. Possible values include: 'JobStatusInvalid', 'JobStatusRunning', 'JobStatusSucceeded', 'JobStatusFailed', 'JobStatusCanceled', 'JobStatusPaused', 'JobStatusScheduled' 3609 StageStatus JobStatus `json:"stageStatus,omitempty"` 3610 // Detail - The details of the stage. 3611 Detail *string `json:"detail,omitempty"` 3612 // ErrorCode - The error code of the stage if any. 3613 ErrorCode *string `json:"errorCode,omitempty"` 3614} 3615 3616// JobStats stats that are available for all jobs in common 3617type JobStats struct { 3618 // CompletedWorkItemCount - Completed work item count. 3619 CompletedWorkItemCount *int32 `json:"completedWorkItemCount,omitempty"` 3620 // TotalWorkItemCount - Total work item count. 3621 TotalWorkItemCount *int32 `json:"totalWorkItemCount,omitempty"` 3622 // EstimatedTimeRemaining - The estimated time remaining. 3623 EstimatedTimeRemaining *int32 `json:"estimatedTimeRemaining,omitempty"` 3624} 3625 3626// Manager the StorSimple Manager 3627type Manager struct { 3628 autorest.Response `json:"-"` 3629 // ManagerProperties - List of properties of the Manager 3630 *ManagerProperties `json:"properties,omitempty"` 3631 // Etag - ETag of the Manager 3632 Etag *string `json:"etag,omitempty"` 3633 // ID - READ-ONLY; The Resource Id 3634 ID *string `json:"id,omitempty"` 3635 // Name - READ-ONLY; The Resource Name 3636 Name *string `json:"name,omitempty"` 3637 // Type - READ-ONLY; The Resource type 3638 Type *string `json:"type,omitempty"` 3639 // Location - The Geo location of the Manager 3640 Location *string `json:"location,omitempty"` 3641 // Tags - Tags attached to the Manager 3642 Tags map[string]*string `json:"tags"` 3643} 3644 3645// MarshalJSON is the custom marshaler for Manager. 3646func (mVar Manager) MarshalJSON() ([]byte, error) { 3647 objectMap := make(map[string]interface{}) 3648 if mVar.ManagerProperties != nil { 3649 objectMap["properties"] = mVar.ManagerProperties 3650 } 3651 if mVar.Etag != nil { 3652 objectMap["etag"] = mVar.Etag 3653 } 3654 if mVar.Location != nil { 3655 objectMap["location"] = mVar.Location 3656 } 3657 if mVar.Tags != nil { 3658 objectMap["tags"] = mVar.Tags 3659 } 3660 return json.Marshal(objectMap) 3661} 3662 3663// UnmarshalJSON is the custom unmarshaler for Manager struct. 3664func (mVar *Manager) UnmarshalJSON(body []byte) error { 3665 var m map[string]*json.RawMessage 3666 err := json.Unmarshal(body, &m) 3667 if err != nil { 3668 return err 3669 } 3670 for k, v := range m { 3671 switch k { 3672 case "properties": 3673 if v != nil { 3674 var managerProperties ManagerProperties 3675 err = json.Unmarshal(*v, &managerProperties) 3676 if err != nil { 3677 return err 3678 } 3679 mVar.ManagerProperties = &managerProperties 3680 } 3681 case "etag": 3682 if v != nil { 3683 var etag string 3684 err = json.Unmarshal(*v, &etag) 3685 if err != nil { 3686 return err 3687 } 3688 mVar.Etag = &etag 3689 } 3690 case "id": 3691 if v != nil { 3692 var ID string 3693 err = json.Unmarshal(*v, &ID) 3694 if err != nil { 3695 return err 3696 } 3697 mVar.ID = &ID 3698 } 3699 case "name": 3700 if v != nil { 3701 var name string 3702 err = json.Unmarshal(*v, &name) 3703 if err != nil { 3704 return err 3705 } 3706 mVar.Name = &name 3707 } 3708 case "type": 3709 if v != nil { 3710 var typeVar string 3711 err = json.Unmarshal(*v, &typeVar) 3712 if err != nil { 3713 return err 3714 } 3715 mVar.Type = &typeVar 3716 } 3717 case "location": 3718 if v != nil { 3719 var location string 3720 err = json.Unmarshal(*v, &location) 3721 if err != nil { 3722 return err 3723 } 3724 mVar.Location = &location 3725 } 3726 case "tags": 3727 if v != nil { 3728 var tags map[string]*string 3729 err = json.Unmarshal(*v, &tags) 3730 if err != nil { 3731 return err 3732 } 3733 mVar.Tags = tags 3734 } 3735 } 3736 } 3737 3738 return nil 3739} 3740 3741// ManagerExtendedInfo the extended info of the manager. 3742type ManagerExtendedInfo struct { 3743 autorest.Response `json:"-"` 3744 // ManagerExtendedInfoProperties - The extended info properties. 3745 *ManagerExtendedInfoProperties `json:"properties,omitempty"` 3746 // Etag - ETag of the Resource 3747 Etag *string `json:"etag,omitempty"` 3748 // ID - READ-ONLY; The identifier. 3749 ID *string `json:"id,omitempty"` 3750 // Name - READ-ONLY; The name. 3751 Name *string `json:"name,omitempty"` 3752 // Type - READ-ONLY; The type. 3753 Type *string `json:"type,omitempty"` 3754} 3755 3756// MarshalJSON is the custom marshaler for ManagerExtendedInfo. 3757func (mei ManagerExtendedInfo) MarshalJSON() ([]byte, error) { 3758 objectMap := make(map[string]interface{}) 3759 if mei.ManagerExtendedInfoProperties != nil { 3760 objectMap["properties"] = mei.ManagerExtendedInfoProperties 3761 } 3762 if mei.Etag != nil { 3763 objectMap["etag"] = mei.Etag 3764 } 3765 return json.Marshal(objectMap) 3766} 3767 3768// UnmarshalJSON is the custom unmarshaler for ManagerExtendedInfo struct. 3769func (mei *ManagerExtendedInfo) UnmarshalJSON(body []byte) error { 3770 var m map[string]*json.RawMessage 3771 err := json.Unmarshal(body, &m) 3772 if err != nil { 3773 return err 3774 } 3775 for k, v := range m { 3776 switch k { 3777 case "properties": 3778 if v != nil { 3779 var managerExtendedInfoProperties ManagerExtendedInfoProperties 3780 err = json.Unmarshal(*v, &managerExtendedInfoProperties) 3781 if err != nil { 3782 return err 3783 } 3784 mei.ManagerExtendedInfoProperties = &managerExtendedInfoProperties 3785 } 3786 case "etag": 3787 if v != nil { 3788 var etag string 3789 err = json.Unmarshal(*v, &etag) 3790 if err != nil { 3791 return err 3792 } 3793 mei.Etag = &etag 3794 } 3795 case "id": 3796 if v != nil { 3797 var ID string 3798 err = json.Unmarshal(*v, &ID) 3799 if err != nil { 3800 return err 3801 } 3802 mei.ID = &ID 3803 } 3804 case "name": 3805 if v != nil { 3806 var name string 3807 err = json.Unmarshal(*v, &name) 3808 if err != nil { 3809 return err 3810 } 3811 mei.Name = &name 3812 } 3813 case "type": 3814 if v != nil { 3815 var typeVar string 3816 err = json.Unmarshal(*v, &typeVar) 3817 if err != nil { 3818 return err 3819 } 3820 mei.Type = &typeVar 3821 } 3822 } 3823 } 3824 3825 return nil 3826} 3827 3828// ManagerExtendedInfoProperties properties of the ManagerExtendedInfo 3829type ManagerExtendedInfoProperties struct { 3830 // Version - Represents the version of the ExtendedInfo object being persisted 3831 Version *string `json:"version,omitempty"` 3832 // IntegrityKey - Represents the CIK of the resource 3833 IntegrityKey *string `json:"integrityKey,omitempty"` 3834 // EncryptionKey - Represents the CEK of the resource 3835 EncryptionKey *string `json:"encryptionKey,omitempty"` 3836 // EncryptionKeyThumbprint - Represents the Cert thumbprint that was used to encrypt the CEK 3837 EncryptionKeyThumbprint *string `json:"encryptionKeyThumbprint,omitempty"` 3838 // PortalCertificateThumbprint - Represents the portal thumbprint which can be used optionally to encrypt the entire data before storing it. 3839 PortalCertificateThumbprint *string `json:"portalCertificateThumbprint,omitempty"` 3840 // Algorithm - Represents the encryption algorithm used to encrypt the other keys. None - if EncryptionKey is saved in plain text format. AlgorithmName - if encryption is used 3841 Algorithm *string `json:"algorithm,omitempty"` 3842} 3843 3844// ManagerIntrinsicSettings intrinsic settings which refers to the type of the StorSimple manager 3845type ManagerIntrinsicSettings struct { 3846 // Type - Refers to the type of the StorSimple Manager. Possible values include: 'GardaV1', 'HelsinkiV1' 3847 Type ManagerType `json:"type,omitempty"` 3848} 3849 3850// ManagerList list of StorSimple Managers under a particular resourceGroup 3851type ManagerList struct { 3852 autorest.Response `json:"-"` 3853 // Value - List of Managers 3854 Value *[]Manager `json:"value,omitempty"` 3855} 3856 3857// ManagerPatch the StorSimple Manager patch. 3858type ManagerPatch struct { 3859 // Tags - The tags attached to the StorSimple Manager. 3860 Tags map[string]*string `json:"tags"` 3861} 3862 3863// MarshalJSON is the custom marshaler for ManagerPatch. 3864func (mp ManagerPatch) MarshalJSON() ([]byte, error) { 3865 objectMap := make(map[string]interface{}) 3866 if mp.Tags != nil { 3867 objectMap["tags"] = mp.Tags 3868 } 3869 return json.Marshal(objectMap) 3870} 3871 3872// ManagerProperties the properties of the Manager 3873type ManagerProperties struct { 3874 // CisIntrinsicSettings - Specifies if the Manager is Garda or Helsinki 3875 CisIntrinsicSettings *ManagerIntrinsicSettings `json:"cisIntrinsicSettings,omitempty"` 3876 // Sku - Specifies the Sku 3877 Sku *ManagerSku `json:"sku,omitempty"` 3878 // ProvisioningState - READ-ONLY; Specifies the state of the resource as it is getting provisioned. Value of "Succeeded" means the Manager was successfully created 3879 ProvisioningState *string `json:"provisioningState,omitempty"` 3880} 3881 3882// ManagerSku the Sku. 3883type ManagerSku struct { 3884 // Name - Refers to the sku name which should be "Standard" 3885 Name *string `json:"name,omitempty"` 3886} 3887 3888// Message ... 3889type Message struct { 3890 Language *string `json:"language,omitempty"` 3891 Value *string `json:"value,omitempty"` 3892} 3893 3894// MetricAvailablity metric availability specifies the time grain (aggregation interval or frequency) and 3895// the retention period for that time grain 3896type MetricAvailablity struct { 3897 // TimeGrain - The time grain, specifies the aggregation interval for the metric. 3898 TimeGrain *string `json:"timeGrain,omitempty"` 3899 // Retention - The retention period for the metric at the specified timegrain 3900 Retention *string `json:"retention,omitempty"` 3901} 3902 3903// MetricData the metric data. 3904type MetricData struct { 3905 // TimeStamp - The time when the metric data is fetched 3906 TimeStamp *date.Time `json:"timeStamp,omitempty"` 3907 // Sum - The sum of all the samples available in the given instance of time for the specific metric data 3908 Sum *float64 `json:"sum,omitempty"` 3909 // Count - The count of samples of the metric data available for the given instance 3910 Count *int32 `json:"count,omitempty"` 3911 // Average - The average of all sample for the given instance 3912 Average *float64 `json:"average,omitempty"` 3913 // Minimum - The minimum of all samples available 3914 Minimum *float64 `json:"minimum,omitempty"` 3915 // Maximum - The maximum of all samples available 3916 Maximum *float64 `json:"maximum,omitempty"` 3917} 3918 3919// MetricDefinition monitoring metric definition represents the metadata of the metrics. 3920type MetricDefinition struct { 3921 // Name - The metric name 3922 Name *MetricName `json:"name,omitempty"` 3923 // Unit - The metric unit. Possible values include: 'Bytes', 'BytesPerSecond', 'Count', 'CountPerSecond', 'Percent', 'Seconds' 3924 Unit MetricUnit `json:"unit,omitempty"` 3925 // PrimaryAggregationType - The metric aggregation type. Possible values include: 'MetricAggregationTypeAverage', 'MetricAggregationTypeLast', 'MetricAggregationTypeMaximum', 'MetricAggregationTypeMinimum', 'MetricAggregationTypeNone', 'MetricAggregationTypeTotal' 3926 PrimaryAggregationType MetricAggregationType `json:"primaryAggregationType,omitempty"` 3927 // ResourceID - The metric source id 3928 ResourceID *string `json:"resourceId,omitempty"` 3929 // MetricAvailabilities - The available metric granularities 3930 MetricAvailabilities *[]MetricAvailablity `json:"metricAvailabilities,omitempty"` 3931 // Dimensions - The supported dimensions 3932 Dimensions *[]MetricDimension `json:"dimensions,omitempty"` 3933 // Type - The metric definition type 3934 Type *string `json:"type,omitempty"` 3935} 3936 3937// MetricDefinitionList list of metric definition 3938type MetricDefinitionList struct { 3939 autorest.Response `json:"-"` 3940 // Value - The list of metric definition 3941 Value *[]MetricDefinition `json:"value,omitempty"` 3942} 3943 3944// MetricDimension metric dimension 3945type MetricDimension struct { 3946 // Name - Metric dimension name 3947 Name *string `json:"name,omitempty"` 3948 // Value - Metric dimension values 3949 Value *string `json:"value,omitempty"` 3950} 3951 3952// MetricFilter class representing the filters to be passed while fetching metrics 3953type MetricFilter struct { 3954 // Name - filter for name property 3955 Name *MetricNameFilter `json:"name,omitempty"` 3956 // StartTime - starttime for fetching metrics 3957 StartTime *date.Time `json:"startTime,omitempty"` 3958 // EndTime - endtime for fetching metrics 3959 EndTime *date.Time `json:"endTime,omitempty"` 3960 // TimeGrain - timegrain of the metrics 3961 TimeGrain *string `json:"timeGrain,omitempty"` 3962} 3963 3964// MetricList collection of metrics 3965type MetricList struct { 3966 autorest.Response `json:"-"` 3967 // Value - The value. 3968 Value *[]Metrics `json:"value,omitempty"` 3969} 3970 3971// MetricName the name of the metric 3972type MetricName struct { 3973 // Value - Name of the metric 3974 Value *string `json:"value,omitempty"` 3975 // LocalizedValue - Localized name of the metric 3976 LocalizedValue *string `json:"localizedValue,omitempty"` 3977} 3978 3979// MetricNameFilter class representing the name filter to be passed while fetching metrics 3980type MetricNameFilter struct { 3981 // Value - The value. 3982 Value *string `json:"value,omitempty"` 3983} 3984 3985// Metrics monitoring metric 3986type Metrics struct { 3987 // ResourceID - The id of metric source 3988 ResourceID *string `json:"resourceId,omitempty"` 3989 // StartTime - The metric start time 3990 StartTime *date.Time `json:"startTime,omitempty"` 3991 // EndTime - The metric end time 3992 EndTime *date.Time `json:"endTime,omitempty"` 3993 // TimeGrain - The time grain, time grain indicates frequency of the metric data 3994 TimeGrain *string `json:"timeGrain,omitempty"` 3995 // PrimaryAggregation - The metric aggregation type. Possible values include: 'MetricAggregationTypeAverage', 'MetricAggregationTypeLast', 'MetricAggregationTypeMaximum', 'MetricAggregationTypeMinimum', 'MetricAggregationTypeNone', 'MetricAggregationTypeTotal' 3996 PrimaryAggregation MetricAggregationType `json:"primaryAggregation,omitempty"` 3997 // Name - The name of the metrics 3998 Name *MetricName `json:"name,omitempty"` 3999 // Dimensions - The Metric dimension which indicates the source of the metric 4000 Dimensions *[]MetricDimension `json:"dimensions,omitempty"` 4001 // Unit - The unit of the metric data. Possible values include: 'Bytes', 'BytesPerSecond', 'Count', 'CountPerSecond', 'Percent', 'Seconds' 4002 Unit MetricUnit `json:"unit,omitempty"` 4003 // Type - The Type of the metric data 4004 Type *string `json:"type,omitempty"` 4005 // Values - The metric data 4006 Values *[]MetricData `json:"values,omitempty"` 4007} 4008 4009// NetworkAdapter represents a networkAdapter in a particular node. 4010type NetworkAdapter struct { 4011 // NetworkAdapterName - The name of the network adapter. 4012 NetworkAdapterName *string `json:"networkAdapterName,omitempty"` 4013 // IPv4Info - The ipv4 configuration of the network adapter. 4014 IPv4Info *IPConfig `json:"iPv4Info,omitempty"` 4015 // IPv6Info - The ipv6 configuration of the network adapter. 4016 IPv6Info *IPConfig `json:"iPv6Info,omitempty"` 4017 // DhcpStatus - Represents state of DHCP. Possible values include: 'DhcpStatusEnabled', 'DhcpStatusDisabled' 4018 DhcpStatus DhcpStatus `json:"dhcpStatus,omitempty"` 4019 // LinkSpeed - The speed of the network adapter. 4020 LinkSpeed *int64 `json:"linkSpeed,omitempty"` 4021} 4022 4023// NetworkSettings the NetworkSettings of a device 4024type NetworkSettings struct { 4025 autorest.Response `json:"-"` 4026 // NetworkSettingsProperties - Properties of the given NetworkSettings. 4027 *NetworkSettingsProperties `json:"properties,omitempty"` 4028 // ID - READ-ONLY; The identifier. 4029 ID *string `json:"id,omitempty"` 4030 // Name - READ-ONLY; The name. 4031 Name *string `json:"name,omitempty"` 4032 // Type - READ-ONLY; The type. 4033 Type *string `json:"type,omitempty"` 4034} 4035 4036// MarshalJSON is the custom marshaler for NetworkSettings. 4037func (ns NetworkSettings) MarshalJSON() ([]byte, error) { 4038 objectMap := make(map[string]interface{}) 4039 if ns.NetworkSettingsProperties != nil { 4040 objectMap["properties"] = ns.NetworkSettingsProperties 4041 } 4042 return json.Marshal(objectMap) 4043} 4044 4045// UnmarshalJSON is the custom unmarshaler for NetworkSettings struct. 4046func (ns *NetworkSettings) UnmarshalJSON(body []byte) error { 4047 var m map[string]*json.RawMessage 4048 err := json.Unmarshal(body, &m) 4049 if err != nil { 4050 return err 4051 } 4052 for k, v := range m { 4053 switch k { 4054 case "properties": 4055 if v != nil { 4056 var networkSettingsProperties NetworkSettingsProperties 4057 err = json.Unmarshal(*v, &networkSettingsProperties) 4058 if err != nil { 4059 return err 4060 } 4061 ns.NetworkSettingsProperties = &networkSettingsProperties 4062 } 4063 case "id": 4064 if v != nil { 4065 var ID string 4066 err = json.Unmarshal(*v, &ID) 4067 if err != nil { 4068 return err 4069 } 4070 ns.ID = &ID 4071 } 4072 case "name": 4073 if v != nil { 4074 var name string 4075 err = json.Unmarshal(*v, &name) 4076 if err != nil { 4077 return err 4078 } 4079 ns.Name = &name 4080 } 4081 case "type": 4082 if v != nil { 4083 var typeVar string 4084 err = json.Unmarshal(*v, &typeVar) 4085 if err != nil { 4086 return err 4087 } 4088 ns.Type = &typeVar 4089 } 4090 } 4091 } 4092 4093 return nil 4094} 4095 4096// NetworkSettingsProperties the properties of NetworkSettings 4097type NetworkSettingsProperties struct { 4098 // PrimaryDNSServer - The Primary DNS server for the device 4099 PrimaryDNSServer *string `json:"primaryDnsServer,omitempty"` 4100 // SecondaryDNSServer - The secondary DNS server for the device 4101 SecondaryDNSServer *string `json:"secondaryDnsServer,omitempty"` 4102 // NodeNetworks - The NetworkAdapters under each node of the device. 4103 NodeNetworks *[]NodeNetwork `json:"nodeNetworks,omitempty"` 4104} 4105 4106// NodeNetwork represents a single node in a device. 4107type NodeNetwork struct { 4108 // NetworkAdapters - The array of network adapters in the node. 4109 NetworkAdapters *[]NetworkAdapter `json:"networkAdapters,omitempty"` 4110} 4111 4112// RawCertificateData raw Certificate Data From IDM 4113type RawCertificateData struct { 4114 // AuthType - Specify the Authentication type. Possible values include: 'Invalid', 'AccessControlService', 'AzureActiveDirectory' 4115 AuthType AuthType `json:"authType,omitempty"` 4116 // Certificate - Gets or sets the base64 encoded certificate raw data string 4117 Certificate *string `json:"certificate,omitempty"` 4118} 4119 4120// Resource the Azure Resource. 4121type Resource struct { 4122 // ID - READ-ONLY; The Resource Id 4123 ID *string `json:"id,omitempty"` 4124 // Name - READ-ONLY; The Resource Name 4125 Name *string `json:"name,omitempty"` 4126 // Type - READ-ONLY; The Resource type 4127 Type *string `json:"type,omitempty"` 4128 // Location - The Geo location of the Manager 4129 Location *string `json:"location,omitempty"` 4130 // Tags - Tags attached to the Manager 4131 Tags map[string]*string `json:"tags"` 4132} 4133 4134// MarshalJSON is the custom marshaler for Resource. 4135func (r Resource) MarshalJSON() ([]byte, error) { 4136 objectMap := make(map[string]interface{}) 4137 if r.Location != nil { 4138 objectMap["location"] = r.Location 4139 } 4140 if r.Tags != nil { 4141 objectMap["tags"] = r.Tags 4142 } 4143 return json.Marshal(objectMap) 4144} 4145 4146// ResourceCertificateAndAADDetails resource Certificate And AAD Details from IDM 4147type ResourceCertificateAndAADDetails struct { 4148 // AuthType - Specify the Authentication type. Possible values include: 'Invalid', 'AccessControlService', 'AzureActiveDirectory' 4149 AuthType AuthType `json:"authType,omitempty"` 4150 // Certificate - Gets or sets the base64 encoded certificate raw data string 4151 Certificate *string `json:"certificate,omitempty"` 4152 // ResourceID - Gets or Sets the ResourceId 4153 ResourceID *int64 `json:"resourceId,omitempty"` 4154 // AadAuthority - AAD tenant authority 4155 AadAuthority *string `json:"aadAuthority,omitempty"` 4156 // AadTenantID - AAD tenant Id 4157 AadTenantID *string `json:"aadTenantId,omitempty"` 4158 // ServicePrincipalClientID - AAD service principal clientId 4159 ServicePrincipalClientID *string `json:"servicePrincipalClientId,omitempty"` 4160 // ServicePrincipalObjectID - AAD service principal ObjectId 4161 ServicePrincipalObjectID *string `json:"servicePrincipalObjectId,omitempty"` 4162 // AzureManagementEndpointAudience - Azure Management Endpoint Audience 4163 AzureManagementEndpointAudience *string `json:"azureManagementEndpointAudience,omitempty"` 4164 // Subject - Certificate Subject Name 4165 Subject *string `json:"subject,omitempty"` 4166 // ValidFrom - Certificate Validity start Date time 4167 ValidFrom *date.Time `json:"validFrom,omitempty"` 4168 // ValidTo - Certificate Validity End Date time 4169 ValidTo *date.Time `json:"validTo,omitempty"` 4170 // Thumbprint - Certificate thumbprint 4171 Thumbprint *string `json:"thumbprint,omitempty"` 4172 // FriendlyName - Certificate friendly name 4173 FriendlyName *string `json:"friendlyName,omitempty"` 4174 // Issuer - Certificate issuer 4175 Issuer *string `json:"issuer,omitempty"` 4176} 4177 4178// SecuritySettings the SecuritySettings of a device 4179type SecuritySettings struct { 4180 // SecuritySettingsProperties - Properties of the SecuritySettings. 4181 *SecuritySettingsProperties `json:"properties,omitempty"` 4182 // ID - READ-ONLY; The identifier. 4183 ID *string `json:"id,omitempty"` 4184 // Name - READ-ONLY; The name. 4185 Name *string `json:"name,omitempty"` 4186 // Type - READ-ONLY; The type. 4187 Type *string `json:"type,omitempty"` 4188} 4189 4190// MarshalJSON is the custom marshaler for SecuritySettings. 4191func (ss SecuritySettings) MarshalJSON() ([]byte, error) { 4192 objectMap := make(map[string]interface{}) 4193 if ss.SecuritySettingsProperties != nil { 4194 objectMap["properties"] = ss.SecuritySettingsProperties 4195 } 4196 return json.Marshal(objectMap) 4197} 4198 4199// UnmarshalJSON is the custom unmarshaler for SecuritySettings struct. 4200func (ss *SecuritySettings) UnmarshalJSON(body []byte) error { 4201 var m map[string]*json.RawMessage 4202 err := json.Unmarshal(body, &m) 4203 if err != nil { 4204 return err 4205 } 4206 for k, v := range m { 4207 switch k { 4208 case "properties": 4209 if v != nil { 4210 var securitySettingsProperties SecuritySettingsProperties 4211 err = json.Unmarshal(*v, &securitySettingsProperties) 4212 if err != nil { 4213 return err 4214 } 4215 ss.SecuritySettingsProperties = &securitySettingsProperties 4216 } 4217 case "id": 4218 if v != nil { 4219 var ID string 4220 err = json.Unmarshal(*v, &ID) 4221 if err != nil { 4222 return err 4223 } 4224 ss.ID = &ID 4225 } 4226 case "name": 4227 if v != nil { 4228 var name string 4229 err = json.Unmarshal(*v, &name) 4230 if err != nil { 4231 return err 4232 } 4233 ss.Name = &name 4234 } 4235 case "type": 4236 if v != nil { 4237 var typeVar string 4238 err = json.Unmarshal(*v, &typeVar) 4239 if err != nil { 4240 return err 4241 } 4242 ss.Type = &typeVar 4243 } 4244 } 4245 } 4246 4247 return nil 4248} 4249 4250// SecuritySettingsProperties the properties of SecuritySettings 4251type SecuritySettingsProperties struct { 4252 // DeviceAdminPassword - Device administrator password as an encrypted string (encrypted using RSA PKCS #1) is used to log into the local web UI of the device. Actual password could have at least 8 characters that are a combination of uppercase, lowercase, numeric, and special characters 4253 DeviceAdminPassword *AsymmetricEncryptedSecret `json:"deviceAdminPassword,omitempty"` 4254} 4255 4256// SendTestAlertEmailRequest request for sending test alert email 4257type SendTestAlertEmailRequest struct { 4258 // EmailList - List of emails to send the test alerts 4259 EmailList *[]string `json:"emailList,omitempty"` 4260} 4261 4262// StorageAccountCredential the storage account credential 4263type StorageAccountCredential struct { 4264 autorest.Response `json:"-"` 4265 // StorageAccountCredentialProperties - Credential properties 4266 *StorageAccountCredentialProperties `json:"properties,omitempty"` 4267 // ID - READ-ONLY; The identifier. 4268 ID *string `json:"id,omitempty"` 4269 // Name - READ-ONLY; The name. 4270 Name *string `json:"name,omitempty"` 4271 // Type - READ-ONLY; The type. 4272 Type *string `json:"type,omitempty"` 4273} 4274 4275// MarshalJSON is the custom marshaler for StorageAccountCredential. 4276func (sac StorageAccountCredential) MarshalJSON() ([]byte, error) { 4277 objectMap := make(map[string]interface{}) 4278 if sac.StorageAccountCredentialProperties != nil { 4279 objectMap["properties"] = sac.StorageAccountCredentialProperties 4280 } 4281 return json.Marshal(objectMap) 4282} 4283 4284// UnmarshalJSON is the custom unmarshaler for StorageAccountCredential struct. 4285func (sac *StorageAccountCredential) UnmarshalJSON(body []byte) error { 4286 var m map[string]*json.RawMessage 4287 err := json.Unmarshal(body, &m) 4288 if err != nil { 4289 return err 4290 } 4291 for k, v := range m { 4292 switch k { 4293 case "properties": 4294 if v != nil { 4295 var storageAccountCredentialProperties StorageAccountCredentialProperties 4296 err = json.Unmarshal(*v, &storageAccountCredentialProperties) 4297 if err != nil { 4298 return err 4299 } 4300 sac.StorageAccountCredentialProperties = &storageAccountCredentialProperties 4301 } 4302 case "id": 4303 if v != nil { 4304 var ID string 4305 err = json.Unmarshal(*v, &ID) 4306 if err != nil { 4307 return err 4308 } 4309 sac.ID = &ID 4310 } 4311 case "name": 4312 if v != nil { 4313 var name string 4314 err = json.Unmarshal(*v, &name) 4315 if err != nil { 4316 return err 4317 } 4318 sac.Name = &name 4319 } 4320 case "type": 4321 if v != nil { 4322 var typeVar string 4323 err = json.Unmarshal(*v, &typeVar) 4324 if err != nil { 4325 return err 4326 } 4327 sac.Type = &typeVar 4328 } 4329 } 4330 } 4331 4332 return nil 4333} 4334 4335// StorageAccountCredentialList collection of Storage account credential entities 4336type StorageAccountCredentialList struct { 4337 autorest.Response `json:"-"` 4338 // Value - The value. 4339 Value *[]StorageAccountCredential `json:"value,omitempty"` 4340} 4341 4342// StorageAccountCredentialProperties storage account properties 4343type StorageAccountCredentialProperties struct { 4344 // CloudType - The cloud service provider. Possible values include: 'Azure', 'S3', 'S3RRS', 'OpenStack', 'HP' 4345 CloudType CloudType `json:"cloudType,omitempty"` 4346 // EndPoint - The storage endpoint 4347 EndPoint *string `json:"endPoint,omitempty"` 4348 // Login - The storage account login 4349 Login *string `json:"login,omitempty"` 4350 // Location - The storage account's geo location 4351 Location *string `json:"location,omitempty"` 4352 // EnableSSL - SSL needs to be enabled or not. Possible values include: 'SslStatusEnabled', 'SslStatusDisabled' 4353 EnableSSL SslStatus `json:"enableSSL,omitempty"` 4354 // AccessKey - The details of the storage account password 4355 AccessKey *AsymmetricEncryptedSecret `json:"accessKey,omitempty"` 4356} 4357 4358// StorageAccountCredentialsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results 4359// of a long-running operation. 4360type StorageAccountCredentialsCreateOrUpdateFuture struct { 4361 azure.Future 4362} 4363 4364// Result returns the result of the asynchronous operation. 4365// If the operation has not completed it will return an error. 4366func (future *StorageAccountCredentialsCreateOrUpdateFuture) Result(client StorageAccountCredentialsClient) (sac StorageAccountCredential, err error) { 4367 var done bool 4368 done, err = future.DoneWithContext(context.Background(), client) 4369 if err != nil { 4370 err = autorest.NewErrorWithError(err, "storsimple.StorageAccountCredentialsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 4371 return 4372 } 4373 if !done { 4374 err = azure.NewAsyncOpIncompleteError("storsimple.StorageAccountCredentialsCreateOrUpdateFuture") 4375 return 4376 } 4377 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4378 if sac.Response.Response, err = future.GetResult(sender); err == nil && sac.Response.Response.StatusCode != http.StatusNoContent { 4379 sac, err = client.CreateOrUpdateResponder(sac.Response.Response) 4380 if err != nil { 4381 err = autorest.NewErrorWithError(err, "storsimple.StorageAccountCredentialsCreateOrUpdateFuture", "Result", sac.Response.Response, "Failure responding to request") 4382 } 4383 } 4384 return 4385} 4386 4387// StorageAccountCredentialsDeleteFuture an abstraction for monitoring and retrieving the results of a 4388// long-running operation. 4389type StorageAccountCredentialsDeleteFuture struct { 4390 azure.Future 4391} 4392 4393// Result returns the result of the asynchronous operation. 4394// If the operation has not completed it will return an error. 4395func (future *StorageAccountCredentialsDeleteFuture) Result(client StorageAccountCredentialsClient) (ar autorest.Response, err error) { 4396 var done bool 4397 done, err = future.DoneWithContext(context.Background(), client) 4398 if err != nil { 4399 err = autorest.NewErrorWithError(err, "storsimple.StorageAccountCredentialsDeleteFuture", "Result", future.Response(), "Polling failure") 4400 return 4401 } 4402 if !done { 4403 err = azure.NewAsyncOpIncompleteError("storsimple.StorageAccountCredentialsDeleteFuture") 4404 return 4405 } 4406 ar.Response = future.Response() 4407 return 4408} 4409 4410// StorageDomain the storage domain. 4411type StorageDomain struct { 4412 autorest.Response `json:"-"` 4413 // StorageDomainProperties - The properties. 4414 *StorageDomainProperties `json:"properties,omitempty"` 4415 // ID - READ-ONLY; The identifier. 4416 ID *string `json:"id,omitempty"` 4417 // Name - READ-ONLY; The name. 4418 Name *string `json:"name,omitempty"` 4419 // Type - READ-ONLY; The type. 4420 Type *string `json:"type,omitempty"` 4421} 4422 4423// MarshalJSON is the custom marshaler for StorageDomain. 4424func (sd StorageDomain) MarshalJSON() ([]byte, error) { 4425 objectMap := make(map[string]interface{}) 4426 if sd.StorageDomainProperties != nil { 4427 objectMap["properties"] = sd.StorageDomainProperties 4428 } 4429 return json.Marshal(objectMap) 4430} 4431 4432// UnmarshalJSON is the custom unmarshaler for StorageDomain struct. 4433func (sd *StorageDomain) UnmarshalJSON(body []byte) error { 4434 var m map[string]*json.RawMessage 4435 err := json.Unmarshal(body, &m) 4436 if err != nil { 4437 return err 4438 } 4439 for k, v := range m { 4440 switch k { 4441 case "properties": 4442 if v != nil { 4443 var storageDomainProperties StorageDomainProperties 4444 err = json.Unmarshal(*v, &storageDomainProperties) 4445 if err != nil { 4446 return err 4447 } 4448 sd.StorageDomainProperties = &storageDomainProperties 4449 } 4450 case "id": 4451 if v != nil { 4452 var ID string 4453 err = json.Unmarshal(*v, &ID) 4454 if err != nil { 4455 return err 4456 } 4457 sd.ID = &ID 4458 } 4459 case "name": 4460 if v != nil { 4461 var name string 4462 err = json.Unmarshal(*v, &name) 4463 if err != nil { 4464 return err 4465 } 4466 sd.Name = &name 4467 } 4468 case "type": 4469 if v != nil { 4470 var typeVar string 4471 err = json.Unmarshal(*v, &typeVar) 4472 if err != nil { 4473 return err 4474 } 4475 sd.Type = &typeVar 4476 } 4477 } 4478 } 4479 4480 return nil 4481} 4482 4483// StorageDomainList collection of storage domains 4484type StorageDomainList struct { 4485 autorest.Response `json:"-"` 4486 // Value - The value. 4487 Value *[]StorageDomain `json:"value,omitempty"` 4488} 4489 4490// StorageDomainProperties the storage domain properties. 4491type StorageDomainProperties struct { 4492 // StorageAccountCredentialIds - The storage account credentials. 4493 StorageAccountCredentialIds *[]string `json:"storageAccountCredentialIds,omitempty"` 4494 // EncryptionKey - The encryption key used to encrypt the data. This is a user secret. 4495 EncryptionKey *AsymmetricEncryptedSecret `json:"encryptionKey,omitempty"` 4496 // EncryptionStatus - The encryption status "Enabled | Disabled". Possible values include: 'EncryptionStatusEnabled', 'EncryptionStatusDisabled' 4497 EncryptionStatus EncryptionStatus `json:"encryptionStatus,omitempty"` 4498} 4499 4500// StorageDomainsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 4501// long-running operation. 4502type StorageDomainsCreateOrUpdateFuture struct { 4503 azure.Future 4504} 4505 4506// Result returns the result of the asynchronous operation. 4507// If the operation has not completed it will return an error. 4508func (future *StorageDomainsCreateOrUpdateFuture) Result(client StorageDomainsClient) (sd StorageDomain, err error) { 4509 var done bool 4510 done, err = future.DoneWithContext(context.Background(), client) 4511 if err != nil { 4512 err = autorest.NewErrorWithError(err, "storsimple.StorageDomainsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 4513 return 4514 } 4515 if !done { 4516 err = azure.NewAsyncOpIncompleteError("storsimple.StorageDomainsCreateOrUpdateFuture") 4517 return 4518 } 4519 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4520 if sd.Response.Response, err = future.GetResult(sender); err == nil && sd.Response.Response.StatusCode != http.StatusNoContent { 4521 sd, err = client.CreateOrUpdateResponder(sd.Response.Response) 4522 if err != nil { 4523 err = autorest.NewErrorWithError(err, "storsimple.StorageDomainsCreateOrUpdateFuture", "Result", sd.Response.Response, "Failure responding to request") 4524 } 4525 } 4526 return 4527} 4528 4529// StorageDomainsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 4530// operation. 4531type StorageDomainsDeleteFuture struct { 4532 azure.Future 4533} 4534 4535// Result returns the result of the asynchronous operation. 4536// If the operation has not completed it will return an error. 4537func (future *StorageDomainsDeleteFuture) Result(client StorageDomainsClient) (ar autorest.Response, err error) { 4538 var done bool 4539 done, err = future.DoneWithContext(context.Background(), client) 4540 if err != nil { 4541 err = autorest.NewErrorWithError(err, "storsimple.StorageDomainsDeleteFuture", "Result", future.Response(), "Polling failure") 4542 return 4543 } 4544 if !done { 4545 err = azure.NewAsyncOpIncompleteError("storsimple.StorageDomainsDeleteFuture") 4546 return 4547 } 4548 ar.Response = future.Response() 4549 return 4550} 4551 4552// SymmetricEncryptedSecret this class can be used as the Type for any secret entity represented as Value, 4553// ValueCertificateThumbprint, EncryptionAlgorithm. In this case, "Value" is a secret and the 4554// "valueThumbprint" represents the certificate thumbprint of the value. The algorithm field is mainly for 4555// future usage to potentially allow different entities encrypted using different algorithms. 4556type SymmetricEncryptedSecret struct { 4557 autorest.Response `json:"-"` 4558 // Value - The value of the secret itself. If the secret is in plaintext or null then EncryptionAlgorithm will be none 4559 Value *string `json:"value,omitempty"` 4560 // ValueCertificateThumbprint - Thumbprint cert that was used to encrypt "Value" 4561 ValueCertificateThumbprint *string `json:"valueCertificateThumbprint,omitempty"` 4562 // EncryptionAlgorithm - Algorithm used to encrypt "Value". Possible values include: 'EncryptionAlgorithmNone', 'EncryptionAlgorithmAES256', 'EncryptionAlgorithmRSAESPKCS1V15' 4563 EncryptionAlgorithm EncryptionAlgorithm `json:"encryptionAlgorithm,omitempty"` 4564} 4565 4566// Time the Time. 4567type Time struct { 4568 // Hour - The hour. 4569 Hour *int32 `json:"hour,omitempty"` 4570 // Minute - The minute. 4571 Minute *int32 `json:"minute,omitempty"` 4572} 4573 4574// TimeSettings the TimeSettings of a device 4575type TimeSettings struct { 4576 autorest.Response `json:"-"` 4577 // TimeSettingsProperties - Properties of the TimeSettings. 4578 *TimeSettingsProperties `json:"properties,omitempty"` 4579 // ID - READ-ONLY; The identifier. 4580 ID *string `json:"id,omitempty"` 4581 // Name - READ-ONLY; The name. 4582 Name *string `json:"name,omitempty"` 4583 // Type - READ-ONLY; The type. 4584 Type *string `json:"type,omitempty"` 4585} 4586 4587// MarshalJSON is the custom marshaler for TimeSettings. 4588func (ts TimeSettings) MarshalJSON() ([]byte, error) { 4589 objectMap := make(map[string]interface{}) 4590 if ts.TimeSettingsProperties != nil { 4591 objectMap["properties"] = ts.TimeSettingsProperties 4592 } 4593 return json.Marshal(objectMap) 4594} 4595 4596// UnmarshalJSON is the custom unmarshaler for TimeSettings struct. 4597func (ts *TimeSettings) UnmarshalJSON(body []byte) error { 4598 var m map[string]*json.RawMessage 4599 err := json.Unmarshal(body, &m) 4600 if err != nil { 4601 return err 4602 } 4603 for k, v := range m { 4604 switch k { 4605 case "properties": 4606 if v != nil { 4607 var timeSettingsProperties TimeSettingsProperties 4608 err = json.Unmarshal(*v, &timeSettingsProperties) 4609 if err != nil { 4610 return err 4611 } 4612 ts.TimeSettingsProperties = &timeSettingsProperties 4613 } 4614 case "id": 4615 if v != nil { 4616 var ID string 4617 err = json.Unmarshal(*v, &ID) 4618 if err != nil { 4619 return err 4620 } 4621 ts.ID = &ID 4622 } 4623 case "name": 4624 if v != nil { 4625 var name string 4626 err = json.Unmarshal(*v, &name) 4627 if err != nil { 4628 return err 4629 } 4630 ts.Name = &name 4631 } 4632 case "type": 4633 if v != nil { 4634 var typeVar string 4635 err = json.Unmarshal(*v, &typeVar) 4636 if err != nil { 4637 return err 4638 } 4639 ts.Type = &typeVar 4640 } 4641 } 4642 } 4643 4644 return nil 4645} 4646 4647// TimeSettingsProperties the properties of TimeSettings 4648type TimeSettingsProperties struct { 4649 // TimeZone - The timezone of device, like '(UTC -06:00) Central America' 4650 TimeZone *string `json:"timeZone,omitempty"` 4651 // PrimaryTimeServer - The primary Network Time Protocol (NTP) server name, like 'time.windows.com'. 4652 PrimaryTimeServer *string `json:"primaryTimeServer,omitempty"` 4653 // SecondaryTimeServer - The secondary Network Time Protocol (NTP) server name, like 'time.contoso.com'. It's optional. 4654 SecondaryTimeServer *string `json:"secondaryTimeServer,omitempty"` 4655} 4656 4657// UpdateDownloadProgress details available during the download 4658type UpdateDownloadProgress struct { 4659 // DownloadPhase - The download phase. Possible values include: 'DownloadPhaseUnknown', 'DownloadPhaseInitializing', 'DownloadPhaseDownloading', 'DownloadPhaseVerifying' 4660 DownloadPhase DownloadPhase `json:"downloadPhase,omitempty"` 4661 // PercentComplete - Percentage of completion. 4662 PercentComplete *int32 `json:"percentComplete,omitempty"` 4663 // TotalBytesToDownload - Total bytes to download. 4664 TotalBytesToDownload *float64 `json:"totalBytesToDownload,omitempty"` 4665 // TotalBytesDownloaded - Total bytes downloaded. 4666 TotalBytesDownloaded *float64 `json:"totalBytesDownloaded,omitempty"` 4667 // NumberOfUpdatesToDownload - Number of updates to download. 4668 NumberOfUpdatesToDownload *int32 `json:"numberOfUpdatesToDownload,omitempty"` 4669 // NumberOfUpdatesDownloaded - Number of updates downloaded. 4670 NumberOfUpdatesDownloaded *int32 `json:"numberOfUpdatesDownloaded,omitempty"` 4671} 4672 4673// UpdateInstallProgress class representing the progress during installation of updates 4674type UpdateInstallProgress struct { 4675 // PercentComplete - Percentage of completion. 4676 PercentComplete *int32 `json:"percentComplete,omitempty"` 4677 // NumberOfUpdatesToInstall - Number of updates to install. 4678 NumberOfUpdatesToInstall *int32 `json:"numberOfUpdatesToInstall,omitempty"` 4679 // NumberOfUpdatesInstalled - Number of updates installed. 4680 NumberOfUpdatesInstalled *int32 `json:"numberOfUpdatesInstalled,omitempty"` 4681} 4682 4683// Updates the updates profile 4684type Updates struct { 4685 autorest.Response `json:"-"` 4686 // UpdatesProperties - Update properties. 4687 *UpdatesProperties `json:"properties,omitempty"` 4688 // ID - READ-ONLY; The identifier. 4689 ID *string `json:"id,omitempty"` 4690 // Name - READ-ONLY; The name. 4691 Name *string `json:"name,omitempty"` 4692 // Type - READ-ONLY; The type. 4693 Type *string `json:"type,omitempty"` 4694} 4695 4696// MarshalJSON is the custom marshaler for Updates. 4697func (u Updates) MarshalJSON() ([]byte, error) { 4698 objectMap := make(map[string]interface{}) 4699 if u.UpdatesProperties != nil { 4700 objectMap["properties"] = u.UpdatesProperties 4701 } 4702 return json.Marshal(objectMap) 4703} 4704 4705// UnmarshalJSON is the custom unmarshaler for Updates struct. 4706func (u *Updates) UnmarshalJSON(body []byte) error { 4707 var m map[string]*json.RawMessage 4708 err := json.Unmarshal(body, &m) 4709 if err != nil { 4710 return err 4711 } 4712 for k, v := range m { 4713 switch k { 4714 case "properties": 4715 if v != nil { 4716 var updatesProperties UpdatesProperties 4717 err = json.Unmarshal(*v, &updatesProperties) 4718 if err != nil { 4719 return err 4720 } 4721 u.UpdatesProperties = &updatesProperties 4722 } 4723 case "id": 4724 if v != nil { 4725 var ID string 4726 err = json.Unmarshal(*v, &ID) 4727 if err != nil { 4728 return err 4729 } 4730 u.ID = &ID 4731 } 4732 case "name": 4733 if v != nil { 4734 var name string 4735 err = json.Unmarshal(*v, &name) 4736 if err != nil { 4737 return err 4738 } 4739 u.Name = &name 4740 } 4741 case "type": 4742 if v != nil { 4743 var typeVar string 4744 err = json.Unmarshal(*v, &typeVar) 4745 if err != nil { 4746 return err 4747 } 4748 u.Type = &typeVar 4749 } 4750 } 4751 } 4752 4753 return nil 4754} 4755 4756// UpdatesProperties properties of the update profile 4757type UpdatesProperties struct { 4758 // DeviceVersion - The current Device version. 4759 DeviceVersion *string `json:"deviceVersion,omitempty"` 4760 // DeviceLastScannedTime - The last time when the device did an update scan. 4761 DeviceLastScannedTime *date.Time `json:"deviceLastScannedTime,omitempty"` 4762 // RegularUpdatesAvailable - Set to true if regular updates were detected for the current version of the device. 4763 RegularUpdatesAvailable *bool `json:"regularUpdatesAvailable,omitempty"` 4764 // RebootRequiredForInstall - Set to true if RegularUpdatesAvailable is true and if at least one of the updateItems detected has needs a reboot to install. 4765 RebootRequiredForInstall *bool `json:"rebootRequiredForInstall,omitempty"` 4766 // TotalItemsPendingForDownload - The total number of items pending for download. 4767 TotalItemsPendingForDownload *int32 `json:"totalItemsPendingForDownload,omitempty"` 4768 // TotalItemsPendingForInstall - The total number of items pending for install. 4769 TotalItemsPendingForInstall *int32 `json:"totalItemsPendingForInstall,omitempty"` 4770 // Status - The current update operation. Possible values include: 'Idle', 'Scanning', 'Downloading', 'Installing' 4771 Status UpdateOperation `json:"status,omitempty"` 4772 // LastCompletedScanTime - The time when the last scan job was completed (success|cancelled|failed) on the device. 4773 LastCompletedScanTime *date.Time `json:"lastCompletedScanTime,omitempty"` 4774 // LastCompletedDownloadJobTime - The time when the last Download job was completed (success|cancelled|failed) on the device. 4775 LastCompletedDownloadJobTime *date.Time `json:"lastCompletedDownloadJobTime,omitempty"` 4776 // LastCompletedInstallJobTime - The time when the last Install job was completed (success|cancelled|failed) on the device. 4777 LastCompletedInstallJobTime *date.Time `json:"lastCompletedInstallJobTime,omitempty"` 4778 // InProgressDownloadJobID - If a download is in progress, this field contains the JobId of that particular download job 4779 InProgressDownloadJobID *string `json:"inProgressDownloadJobId,omitempty"` 4780 // InProgressInstallJobID - If an install is in progress, this field contains the JobId of that particular install job 4781 InProgressInstallJobID *string `json:"inProgressInstallJobId,omitempty"` 4782 // InProgressScanStartedTime - The time when the currently running scan (if any) started 4783 InProgressScanStartedTime *date.Time `json:"inProgressScanStartedTime,omitempty"` 4784 // InProgressDownloadJobStartedTime - The time when the currently running download (if any) started 4785 InProgressDownloadJobStartedTime *date.Time `json:"inProgressDownloadJobStartedTime,omitempty"` 4786 // InProgressInstallJobStartedTime - The time when the currently running install (if any) started 4787 InProgressInstallJobStartedTime *date.Time `json:"inProgressInstallJobStartedTime,omitempty"` 4788} 4789 4790// UploadCertificateRequest upload Certificate Request to IDM 4791type UploadCertificateRequest struct { 4792 *RawCertificateData `json:"properties,omitempty"` 4793 // ContractVersion - READ-ONLY; Gets ContractVersion. Possible values include: 'InvalidVersion', 'V201109', 'V201202', 'V201205', 'V201212', 'V201304', 'V201310', 'V201311', 'V201404', 'V201406', 'V201407', 'V201409', 'V201410', 'V201412', 'V201501', 'V201502', 'V201504', 'V201505', 'V201506', 'V201507', 'V201508', 'V201510', 'V201512', 'V201601', 'V201602', 'V201604', 'V201605', 'V201607', 'V201608' 4794 ContractVersion ContractVersions `json:"contractVersion,omitempty"` 4795} 4796 4797// MarshalJSON is the custom marshaler for UploadCertificateRequest. 4798func (ucr UploadCertificateRequest) MarshalJSON() ([]byte, error) { 4799 objectMap := make(map[string]interface{}) 4800 if ucr.RawCertificateData != nil { 4801 objectMap["properties"] = ucr.RawCertificateData 4802 } 4803 return json.Marshal(objectMap) 4804} 4805 4806// UnmarshalJSON is the custom unmarshaler for UploadCertificateRequest struct. 4807func (ucr *UploadCertificateRequest) UnmarshalJSON(body []byte) error { 4808 var m map[string]*json.RawMessage 4809 err := json.Unmarshal(body, &m) 4810 if err != nil { 4811 return err 4812 } 4813 for k, v := range m { 4814 switch k { 4815 case "properties": 4816 if v != nil { 4817 var rawCertificateData RawCertificateData 4818 err = json.Unmarshal(*v, &rawCertificateData) 4819 if err != nil { 4820 return err 4821 } 4822 ucr.RawCertificateData = &rawCertificateData 4823 } 4824 case "contractVersion": 4825 if v != nil { 4826 var contractVersion ContractVersions 4827 err = json.Unmarshal(*v, &contractVersion) 4828 if err != nil { 4829 return err 4830 } 4831 ucr.ContractVersion = contractVersion 4832 } 4833 } 4834 } 4835 4836 return nil 4837} 4838 4839// UploadCertificateResponse upload Certificate Response from IDM 4840type UploadCertificateResponse struct { 4841 autorest.Response `json:"-"` 4842 *ResourceCertificateAndAADDetails `json:"properties,omitempty"` 4843 // ID - READ-ONLY; The identifier. 4844 ID *string `json:"id,omitempty"` 4845 // Name - READ-ONLY; The name. 4846 Name *string `json:"name,omitempty"` 4847 // Type - READ-ONLY; The type. 4848 Type *string `json:"type,omitempty"` 4849} 4850 4851// MarshalJSON is the custom marshaler for UploadCertificateResponse. 4852func (ucr UploadCertificateResponse) MarshalJSON() ([]byte, error) { 4853 objectMap := make(map[string]interface{}) 4854 if ucr.ResourceCertificateAndAADDetails != nil { 4855 objectMap["properties"] = ucr.ResourceCertificateAndAADDetails 4856 } 4857 return json.Marshal(objectMap) 4858} 4859 4860// UnmarshalJSON is the custom unmarshaler for UploadCertificateResponse struct. 4861func (ucr *UploadCertificateResponse) UnmarshalJSON(body []byte) error { 4862 var m map[string]*json.RawMessage 4863 err := json.Unmarshal(body, &m) 4864 if err != nil { 4865 return err 4866 } 4867 for k, v := range m { 4868 switch k { 4869 case "properties": 4870 if v != nil { 4871 var resourceCertificateAndAADDetails ResourceCertificateAndAADDetails 4872 err = json.Unmarshal(*v, &resourceCertificateAndAADDetails) 4873 if err != nil { 4874 return err 4875 } 4876 ucr.ResourceCertificateAndAADDetails = &resourceCertificateAndAADDetails 4877 } 4878 case "id": 4879 if v != nil { 4880 var ID string 4881 err = json.Unmarshal(*v, &ID) 4882 if err != nil { 4883 return err 4884 } 4885 ucr.ID = &ID 4886 } 4887 case "name": 4888 if v != nil { 4889 var name string 4890 err = json.Unmarshal(*v, &name) 4891 if err != nil { 4892 return err 4893 } 4894 ucr.Name = &name 4895 } 4896 case "type": 4897 if v != nil { 4898 var typeVar string 4899 err = json.Unmarshal(*v, &typeVar) 4900 if err != nil { 4901 return err 4902 } 4903 ucr.Type = &typeVar 4904 } 4905 } 4906 } 4907 4908 return nil 4909} 4910